summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Output.cxx13
-rw-r--r--test/expect/gccxml.Class-abstract-xml.txt23
-rw-r--r--test/input/Class-abstract.cxx2
3 files changed, 29 insertions, 9 deletions
diff --git a/src/Output.cxx b/src/Output.cxx
index 8067f51..4e95752 100644
--- a/src/Output.cxx
+++ b/src/Output.cxx
@@ -265,6 +265,7 @@ class ASTVisitor: public ASTVisitorBase
FH_Explicit = (1<<2),
FH_Const = (1<<3),
FH_Virtual = (1<<4),
+ FH_Pure = (1<<5),
FH__Last
};
@@ -958,6 +959,9 @@ void ASTVisitor::OutputFunctionHelper(clang::FunctionDecl const* d,
if(flags & FH_Virtual) {
this->OS << " virtual=\"1\"";
}
+ if(flags & FH_Pure) {
+ this->OS << " pure_virtual=\"1\"";
+ }
if(d->isInlined()) {
this->OS << " inline=\"1\"";
}
@@ -1250,6 +1254,9 @@ void ASTVisitor::OutputCXXMethodDecl(clang::CXXMethodDecl const* d,
if(d->isVirtual()) {
flags |= FH_Virtual;
}
+ if(d->isPure()) {
+ flags |= FH_Pure;
+ }
if(d->isOverloadedOperator()) {
this->OutputFunctionHelper(d, dn, "OperatorMethod",
clang::getOperatorSpelling(d->getOverloadedOperator()), flags);
@@ -1269,6 +1276,9 @@ void ASTVisitor::OutputCXXConversionDecl(clang::CXXConversionDecl const* d,
if(d->isVirtual()) {
flags |= FH_Virtual;
}
+ if(d->isPure()) {
+ flags |= FH_Pure;
+ }
this->OutputFunctionHelper(d, dn, "Converter", "", flags);
}
@@ -1292,6 +1302,9 @@ void ASTVisitor::OutputCXXDestructorDecl(clang::CXXDestructorDecl const* d,
if(d->isVirtual()) {
flags |= FH_Virtual;
}
+ if(d->isPure()) {
+ flags |= FH_Pure;
+ }
this->OutputFunctionHelper(d, dn, "Destructor",
this->GetContextName(d), flags);
}
diff --git a/test/expect/gccxml.Class-abstract-xml.txt b/test/expect/gccxml.Class-abstract-xml.txt
index 8737efc..3ffcd9d 100644
--- a/test/expect/gccxml.Class-abstract-xml.txt
+++ b/test/expect/gccxml.Class-abstract-xml.txt
@@ -1,16 +1,21 @@
^<\?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"/>
+ <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" abstract="1" members="_3 _4 _5 _6 _7 _8"/>
+ <Method id="_3" name="method" returns="_9" context="_1" access="private" location="f1:2" file="f1" line="2" virtual="1" pure_virtual="1">
+ <Argument type="_9" location="f1:2" file="f1" line="2"/>
+ </Method>
+ <Converter id="_4" returns="_9" context="_1" access="private" location="f1:3" file="f1" line="3" virtual="1" pure_virtual="1"/>
+ <Destructor id="_5" name="start" context="_1" access="private" location="f1:4" file="f1" line="4" virtual="1" pure_virtual="1"/>
+ <OperatorMethod id="_6" name="=" returns="_10" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1">
+ <Argument type="_11" 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 id="_7" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"/>
+ <Constructor id="_8" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1">
+ <Argument type="_11" location="f1:1" file="f1" line="1"/>
</Constructor>
- <ReferenceType id="_7" type="_1"/>
- <ReferenceType id="_8" type="_1c"/>
+ <FundamentalType id="_9" name="int"/>
+ <ReferenceType id="_10" type="_1"/>
+ <ReferenceType id="_11" type="_1c"/>
<Namespace id="_2" name="::"/>
<CvQualifiedType id="_1c" type="_1" const="1"/>
<File id="f1" name=".*/test/input/Class-abstract.cxx"/>
diff --git a/test/input/Class-abstract.cxx b/test/input/Class-abstract.cxx
index 7615532..419c6ec 100644
--- a/test/input/Class-abstract.cxx
+++ b/test/input/Class-abstract.cxx
@@ -1,3 +1,5 @@
class start {
+ virtual int method(int) = 0;
+ virtual operator int() = 0;
virtual ~start() = 0;
};