From 2a87046db10851ff1b8e101ecc345657ce663c76 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Dec 2015 09:59:02 -0500 Subject: Output: Skip Typedef elements that refer to rvalue references The gccxml output format may contain only C++98 constructs. --- src/Output.cxx | 7 +++++++ test/expect/gccxml.any.RValueReferenceType.xml.txt | 6 ++---- test/input/RValueReferenceType.cxx | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Output.cxx b/src/Output.cxx index 43af2e1..811364e 100644 --- a/src/Output.cxx +++ b/src/Output.cxx @@ -567,6 +567,13 @@ ASTVisitor::DumpId ASTVisitor::AddDeclDumpNode(clang::Decl const* d, } } } + + if (clang::TypedefDecl const* td = + clang::dyn_cast(d)) { + if (td->getUnderlyingType()->isRValueReferenceType()) { + return DumpId(); + } + } } return this->AddDumpNodeImpl(d, complete); diff --git a/test/expect/gccxml.any.RValueReferenceType.xml.txt b/test/expect/gccxml.any.RValueReferenceType.xml.txt index 6899e98..763161e 100644 --- a/test/expect/gccxml.any.RValueReferenceType.xml.txt +++ b/test/expect/gccxml.any.RValueReferenceType.xml.txt @@ -1,7 +1,5 @@ ^<\?xml version="1.0"\?> ]*> - - - - + + $ diff --git a/test/input/RValueReferenceType.cxx b/test/input/RValueReferenceType.cxx index 44f0232..35f2861 100644 --- a/test/input/RValueReferenceType.cxx +++ b/test/input/RValueReferenceType.cxx @@ -1 +1,3 @@ -typedef int&& start; +namespace start { + typedef int&& type; +} -- cgit v0.12