summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Output.cxx2
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/expect/gccxml.Typedef-to-FundamentalType-mode-xml.txt7
-rw-r--r--test/input/Typedef-to-FundamentalType-mode.cxx1
4 files changed, 10 insertions, 1 deletions
diff --git a/src/Output.cxx b/src/Output.cxx
index 0cee6ca..dab1230 100644
--- a/src/Output.cxx
+++ b/src/Output.cxx
@@ -1169,7 +1169,7 @@ void ASTVisitor::OutputTypedefDecl(clang::TypedefDecl const* d,
this->OS << " <Typedef";
this->PrintIdAttribute(dn);
this->PrintNameAttribute(d->getName().str());
- this->PrintTypeAttribute(d->getTypeSourceInfo()->getType(), dn->Complete);
+ this->PrintTypeAttribute(d->getUnderlyingType(), dn->Complete);
this->PrintContextAttribute(d);
this->PrintLocationAttribute(d);
this->OS << "/>\n";
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e95af68..0441ce7 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -121,6 +121,7 @@ castxml_test_gccxml(Typedef-paren)
castxml_test_gccxml(Typedef-to-Class-template)
castxml_test_gccxml(Typedef-to-Enumeration)
castxml_test_gccxml(Typedef-to-Enumeration-anonymous)
+castxml_test_gccxml(Typedef-to-FundamentalType-mode)
castxml_test_gccxml(Variable)
castxml_test_gccxml(Variable-in-Class)
castxml_test_gccxml(Variable-init)
diff --git a/test/expect/gccxml.Typedef-to-FundamentalType-mode-xml.txt b/test/expect/gccxml.Typedef-to-FundamentalType-mode-xml.txt
new file mode 100644
index 0000000..c43eca1
--- /dev/null
+++ b/test/expect/gccxml.Typedef-to-FundamentalType-mode-xml.txt
@@ -0,0 +1,7 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Typedef id="_1" name="start" type="_2" context="_3" location="f1:1" file="f1" line="1"/>
+ <FundamentalType id="_2" name="short int"/>
+ <Namespace id="_3" name="::"/>
+ <File id="f1" name=".*/test/input/Typedef-to-FundamentalType-mode.cxx"/>
+</GCC_XML>$
diff --git a/test/input/Typedef-to-FundamentalType-mode.cxx b/test/input/Typedef-to-FundamentalType-mode.cxx
new file mode 100644
index 0000000..03869e9
--- /dev/null
+++ b/test/input/Typedef-to-FundamentalType-mode.cxx
@@ -0,0 +1 @@
+typedef int start __attribute__ ((__mode__ (__HI__)));