diff options
-rw-r--r-- | src/Output.cxx | 4 | ||||
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/expect/gccxml.Class-abstract-xml.txt | 17 | ||||
-rw-r--r-- | test/input/Class-abstract.cxx | 3 |
4 files changed, 25 insertions, 0 deletions
diff --git a/src/Output.cxx b/src/Output.cxx index 99ef36c..73bfcec 100644 --- a/src/Output.cxx +++ b/src/Output.cxx @@ -1005,6 +1005,7 @@ void ASTVisitor::OutputRecordDecl(clang::RecordDecl const* d, case clang::TTK_Interface: return; case clang::TTK_Enum: return; } + clang::CXXRecordDecl const* dx = clang::dyn_cast<clang::CXXRecordDecl>(d); this->OS << " <" << tag; this->PrintIdAttribute(dn); @@ -1014,6 +1015,9 @@ void ASTVisitor::OutputRecordDecl(clang::RecordDecl const* d, this->PrintContextAttribute(d); this->PrintLocationAttribute(d); if(d->getDefinition()) { + if(dx && dx->isAbstract()) { + this->OS << " abstract=\"1\""; + } if(dn->Complete) { this->PrintMembersAttribute(d); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 49ce30f..8dc4201 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -68,6 +68,7 @@ castxml_test_cmd(start-missing --castxml-start) castxml_test_gccxml(ArrayType) castxml_test_gccxml(ArrayType-incomplete) castxml_test_gccxml(Class) +castxml_test_gccxml(Class-abstract) castxml_test_gccxml(Class-incomplete) castxml_test_gccxml(Class-template) castxml_test_gccxml(CvQualifiedType) diff --git a/test/expect/gccxml.Class-abstract-xml.txt b/test/expect/gccxml.Class-abstract-xml.txt new file mode 100644 index 0000000..8737efc --- /dev/null +++ b/test/expect/gccxml.Class-abstract-xml.txt @@ -0,0 +1,17 @@ +^<\?xml version="1.0"\?> +<GCC_XML[^>]*> + <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" abstract="1" members="_3 _4 _5 _6"/> + <Destructor id="_3" name="start" context="_1" access="private" location="f1:2" file="f1" line="2" virtual="1"/> + <OperatorMethod id="_4" name="=" returns="_7" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"> + <Argument type="_8" location="f1:1" file="f1" line="1"/> + </OperatorMethod> + <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"/> + <Constructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"> + <Argument type="_8" location="f1:1" file="f1" line="1"/> + </Constructor> + <ReferenceType id="_7" type="_1"/> + <ReferenceType id="_8" type="_1c"/> + <Namespace id="_2" name="::"/> + <CvQualifiedType id="_1c" type="_1" const="1"/> + <File id="f1" name=".*/test/input/Class-abstract.cxx"/> +</GCC_XML>$ diff --git a/test/input/Class-abstract.cxx b/test/input/Class-abstract.cxx new file mode 100644 index 0000000..7615532 --- /dev/null +++ b/test/input/Class-abstract.cxx @@ -0,0 +1,3 @@ +class start { + virtual ~start() = 0; +}; |