[med-svn] [castxml] 01/07: Imported Upstream version 0.1+git20160412

Gert Wollny gert-guest at moszumanska.debian.org
Thu Apr 14 11:42:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

gert-guest pushed a commit to branch master
in repository castxml.

commit 221194257e0684cb91c3c2eecab80a08e4dc97ee
Author: Gert Wollny <gw.fossdev at gmail.com>
Date:   Thu Apr 14 10:42:02 2016 +0000

    Imported Upstream version 0.1+git20160412
---
 doc/manual/castxml.1.rst                           |   7 +-
 src/Output.cxx                                     | 118 +++++++++++++++++++--
 src/RunClang.cxx                                   |  58 +++++++---
 src/Version.cmake                                  |   2 +-
 test/CMakeLists.txt                                |  34 ++++++
 test/expect/cmd.cc-gnu-c-tgt-i386-opt-E.stdout.txt |  11 ++
 test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt   |  12 +++
 test/expect/cmd.gccxml-and-c11.stderr.txt          |   1 -
 test/expect/cmd.gccxml-and-c99.result.txt          |   1 -
 test/expect/cmd.gccxml-and-c99.stderr.txt          |   1 -
 ...y.Class-implicit-member-const-aggregate.xml.txt |  15 +++
 ...gccxml.any.Class-member-template-access.xml.txt |  29 +++++
 .../gccxml.any.Class-template-recurse.xml.txt      |  18 ++++
 ...cxml.any.Function-Argument-default-cast.xml.txt |  48 +++++++++
 ...gccxml.any.Function-Argument-default-ns.xml.txt |  17 +++
 ...gccxml.any.Method-Argument-default-cast.xml.txt |  27 +++++
 .../gccxml.any.Method-Argument-default.xml.txt     |  23 ++++
 test/expect/gccxml.any.Variable-init-cast.xml.txt  |  10 ++
 test/expect/gccxml.any.Variable-init-ns.xml.txt    |  10 ++
 ...to.xml.txt => gccxml.c.FunctionNoProto.xml.txt} |   0
 ...pe.xml.txt => gccxml.c.FundamentalType.xml.txt} |   0
 ...l.txt => gccxml.c.GNU-float128-nostart.xml.txt} |   0
 ...at128.xml.txt => gccxml.c.GNU-float128.xml.txt} |   0
 ...ck.xml.txt => gccxml.c.GNU-va_arg_pack.xml.txt} |   0
 ...l.txt => gccxml.c.Typedef-called-class.xml.txt} |   0
 ...-c11.result.txt => gccxml.c.invalid.result.txt} |   0
 ...alid.stderr.txt => gccxml.c.invalid.stderr.txt} |   0
 test/expect/gccxml.c89.invalid.result.txt          |   1 -
 .../Class-implicit-member-const-aggregate.cxx      |   3 +
 test/input/Class-member-template-access.cxx        |   4 +
 test/input/Class-template-recurse.cxx              |  11 ++
 test/input/Function-Argument-default-cast.cxx      |  13 +++
 test/input/Function-Argument-default-ns.cxx        |   5 +
 test/input/Method-Argument-default-cast.cxx        |   8 ++
 test/input/Method-Argument-default.cxx             |   4 +
 test/input/Variable-init-cast.cxx                  |   5 +
 test/input/Variable-init-ns.cxx                    |   4 +
 test/run.cmake                                     |   2 +-
 38 files changed, 466 insertions(+), 36 deletions(-)

diff --git a/doc/manual/castxml.1.rst b/doc/manual/castxml.1.rst
index 250372c..82791cb 100644
--- a/doc/manual/castxml.1.rst
+++ b/doc/manual/castxml.1.rst
@@ -55,9 +55,10 @@ Remaining options are given to the internal Clang compiler.
   Write output to ``<src>.xml`` or file named by ``-o``.
   The gccxml format does not support Clang language modes other than
   ``-std=c++98`` or ``-std=c89``.  This output format may be used with
-  language modes ``-std=c++11`` and ``-std=c++14`` but the output will
-  not contain implicit move constructors or move assignment operators,
-  and may contain ``<Unimplemented/>`` elements on non-c++98 constructs.
+  language modes ``-std=c++11``, ``-std=c++14``, ``-std=c99``, and
+  ``-std=c11`` but the output will not contain implicit move constructors
+  or move assignment operators, and may contain ``<Unimplemented/>``
+  elements on non-c++98 constructs.
 
 ``--castxml-start <name>[,<name>]...``
   Start AST traversal at declaration(s) with the given qualified name(s).
diff --git a/src/Output.cxx b/src/Output.cxx
index ab76b81..2ec5d79 100644
--- a/src/Output.cxx
+++ b/src/Output.cxx
@@ -25,7 +25,10 @@
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclOpenMP.h"
 #include "clang/AST/DeclTemplate.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/ExprCXX.h"
 #include "clang/AST/Mangle.h"
+#include "clang/AST/PrettyPrinter.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/Basic/Specifiers.h"
 #include "clang/Frontend/CompilerInstance.h"
@@ -217,6 +220,15 @@ class ASTVisitor: public ASTVisitorBase
     }
   };
 
+  class PrinterHelper: public clang::PrinterHelper {
+    ASTVisitor& Visitor;
+  public:
+    PrinterHelper(ASTVisitor& v): Visitor(v) {}
+    bool handledStmt(clang::Stmt* s, llvm::raw_ostream& os) override {
+      return this->Visitor.PrintHelpStmt(s, os);
+    }
+  };
+
   /** Get the dump status node for a Clang declaration.  */
   DumpNode* GetDumpNode(clang::Decl const* d) {
     return &this->DeclNodes[d];
@@ -399,6 +411,9 @@ class ASTVisitor: public ASTVisitorBase
   void OutputFunctionArgument(clang::ParmVarDecl const* a, bool complete,
                               clang::Expr const* def);
 
+  /** Print some statements (expressions) in a custom form.  */
+  bool PrintHelpStmt(clang::Stmt const* s, llvm::raw_ostream& os);
+
   /** Print an access="..." attribute.  */
   void PrintAccessAttribute(clang::AccessSpecifier as);
 
@@ -406,7 +421,8 @@ class ASTVisitor: public ASTVisitorBase
       the containing declaration context (namespace, class, etc.).
       Also prints access="..." attribute for class members to
       indicate public, protected, or private membership.  */
-  void PrintContextAttribute(clang::Decl const* d);
+  void PrintContextAttribute(clang::Decl const* d,
+                             clang::AccessSpecifier alt = clang::AS_none);
 
   void PrintFloat128Type(DumpNode const* dn);
 
@@ -1159,25 +1175,93 @@ void ASTVisitor::PrintLocationAttribute(clang::Decl const* d)
 }
 
 //----------------------------------------------------------------------------
+bool ASTVisitor::PrintHelpStmt(clang::Stmt const* s, llvm::raw_ostream& os)
+{
+  switch (s->getStmtClass()) {
+  case clang::Stmt::CStyleCastExprClass: {
+    // Duplicate clang::StmtPrinter::VisitCStyleCastExpr
+    // but with canonical type so we do not print an unqualified name.
+    clang::CStyleCastExpr const* e =
+      static_cast<clang::CStyleCastExpr const*>(s);
+    os << "(";
+    e->getTypeAsWritten().getCanonicalType().print(os, this->PrintingPolicy);
+    os << ")";
+    PrinterHelper ph(*this);
+    e->getSubExpr()->printPretty(os, &ph, this->PrintingPolicy);
+    return true;
+  } break;
+  case clang::Stmt::CXXConstCastExprClass: // fallthrough
+  case clang::Stmt::CXXDynamicCastExprClass: // fallthrough
+  case clang::Stmt::CXXReinterpretCastExprClass: // fallthrough
+  case clang::Stmt::CXXStaticCastExprClass: {
+    // Duplicate clang::StmtPrinter::VisitCXXNamedCastExpr
+    // but with canonical type so we do not print an unqualified name.
+    clang::CXXNamedCastExpr const* e =
+      static_cast<clang::CXXNamedCastExpr const*>(s);
+    os << e->getCastName() << '<';
+    e->getTypeAsWritten().getCanonicalType().print(os, this->PrintingPolicy);
+    os << ">(";
+    PrinterHelper ph(*this);
+    e->getSubExpr()->printPretty(os, &ph, this->PrintingPolicy);
+    os << ")";
+    return true;
+  } break;
+  case clang::Stmt::DeclRefExprClass: {
+    // Print the fully qualified name of the referenced declaration.
+    clang::DeclRefExpr const* e = static_cast<clang::DeclRefExpr const*>(s);
+    if (clang::NamedDecl const* d =
+        clang::dyn_cast<clang::NamedDecl>(e->getDecl())) {
+      std::string s;
+      {
+        llvm::raw_string_ostream rso(s);
+        d->printQualifiedName(rso, this->PrintingPolicy);
+        rso.str();
+      }
+      if (clang::isa<clang::EnumConstantDecl>(d)) {
+        // Clang does not exclude the "::" after an unnamed enum type.
+        std::string::size_type pos = s.find("::::");
+        if (pos != s.npos) {
+          s.erase(pos, 2);
+        }
+      }
+      os << s;
+      return true;
+    }
+  } break;
+  default:
+    break;
+  }
+  return false;
+}
+
+//----------------------------------------------------------------------------
 void ASTVisitor::PrintAccessAttribute(clang::AccessSpecifier as)
 {
-  if (as == clang::AS_private) {
+  switch (as) {
+  case clang::AS_private:
     this->OS << " access=\"private\"";
-  } else if (as == clang::AS_protected) {
+    break;
+  case clang::AS_protected:
     this->OS << " access=\"protected\"";
-  } else {
+    break;
+  case clang::AS_public:
     this->OS << " access=\"public\"";
+    break;
+  case clang::AS_none:
+    break;
   }
 }
 
 //----------------------------------------------------------------------------
-void ASTVisitor::PrintContextAttribute(clang::Decl const* d)
+void ASTVisitor::PrintContextAttribute(clang::Decl const* d,
+                                       clang::AccessSpecifier alt)
 {
   clang::DeclContext const* dc = d->getDeclContext();
   if(DumpId id = this->GetContextIdRef(dc)) {
     this->OS << " context=\"_" << id << "\"";
     if (dc->isRecord()) {
-      this->PrintAccessAttribute(d->getAccess());
+      clang::AccessSpecifier as = d->getAccess();
+      this->PrintAccessAttribute(as != clang::AS_none? as : alt);
     }
   }
 }
@@ -1488,7 +1572,8 @@ void ASTVisitor::OutputFunctionArgument(clang::ParmVarDecl const* a,
     this->OS << " default=\"";
     std::string s;
     llvm::raw_string_ostream rso(s);
-    def->printPretty(rso, 0, this->PrintingPolicy);
+    PrinterHelper ph(*this);
+    def->printPretty(rso, &ph, this->PrintingPolicy);
     this->OS << encodeXML(rso.str());
     this->OS << "\"";
   }
@@ -1561,7 +1646,19 @@ void ASTVisitor::OutputRecordDecl(clang::RecordDecl const* d,
     d->getNameForDiagnostic(rso, this->PrintingPolicy, false);
     this->PrintNameAttribute(rso.str());
   }
-  this->PrintContextAttribute(d);
+  clang::AccessSpecifier access = clang::AS_none;
+  if (dx) {
+    // If this is a template instantiation then get the access of the original
+    // template.  Access of the instantiation itself has no meaning.
+    if (clang::CXXRecordDecl const* dxp =
+        dx->getTemplateInstantiationPattern()) {
+      if (clang::ClassTemplateDecl const* dxpt =
+          dxp->getDescribedClassTemplate()) {
+        access = dxpt->getAccess();
+      }
+    }
+  }
+  this->PrintContextAttribute(d, access);
   this->PrintLocationAttribute(d);
   if(d->getDefinition()) {
     if(dx && dx->isAbstract()) {
@@ -1719,7 +1816,8 @@ void ASTVisitor::OutputVarDecl(clang::VarDecl const* d, DumpNode const* dn)
     this->OS << " init=\"";
     std::string s;
     llvm::raw_string_ostream rso(s);
-    init->printPretty(rso, 0, this->PrintingPolicy);
+    PrinterHelper ph(*this);
+    init->printPretty(rso, &ph, this->PrintingPolicy);
     this->OS << encodeXML(rso.str());
     this->OS << "\"";
   }
@@ -2006,7 +2104,7 @@ void ASTVisitor::HandleTranslationUnit(clang::TranslationUnitDecl const* tu)
   // Start dump with gccxml-compatible format.
   this->OS <<
     "<?xml version=\"1.0\"?>\n"
-    "<GCC_XML version=\"0.9.0\" cvs_revision=\"1.136\">\n"
+    "<GCC_XML version=\"0.9.0\" cvs_revision=\"1.137\">\n"
     ;
 
   // Dump the complete nodes.
diff --git a/src/RunClang.cxx b/src/RunClang.cxx
index 9768a25..515cf4f 100644
--- a/src/RunClang.cxx
+++ b/src/RunClang.cxx
@@ -56,13 +56,22 @@ class ASTConsumer: public clang::ASTConsumer
   clang::CompilerInstance& CI;
   llvm::raw_ostream& OS;
   Options const& Opts;
-  std::queue<clang::CXXRecordDecl*> Classes;
+  struct Class {
+    clang::CXXRecordDecl* RD;
+    int Depth;
+    Class(clang::CXXRecordDecl* rd, int depth): RD(rd), Depth(depth) {}
+  };
+  std::queue<Class> Classes;
+  int ClassImplicitMemberDepth = 0;
 public:
   ASTConsumer(clang::CompilerInstance& ci, llvm::raw_ostream& os,
               Options const& opts):
     CI(ci), OS(os), Opts(opts) {}
 
-  void AddImplicitMembers(clang::CXXRecordDecl* rd) {
+  void AddImplicitMembers(Class const& c) {
+    clang::CXXRecordDecl* rd = c.RD;
+    this->ClassImplicitMemberDepth = c.Depth + 1;
+
     clang::Sema& sema = this->CI.getSema();
     sema.ForceDeclarationOfImplicitMembers(rd);
 
@@ -71,13 +80,13 @@ public:
       clang::CXXMethodDecl* m = clang::dyn_cast<clang::CXXMethodDecl>(*i);
       if(m && !m->isDeleted() && !m->isInvalidDecl()) {
         bool mark = false;
-        if (clang::CXXConstructorDecl* c =
-           clang::dyn_cast<clang::CXXConstructorDecl>(m)) {
+        clang::CXXConstructorDecl* c =
+           clang::dyn_cast<clang::CXXConstructorDecl>(m);
+        if (c) {
           mark = (c->isDefaultConstructor() ||
                   c->isCopyConstructor() ||
                   c->isMoveConstructor());
-        } else if (clang::CXXDestructorDecl* d =
-                   clang::dyn_cast<clang::CXXDestructorDecl>(m)) {
+        } else if (clang::dyn_cast<clang::CXXDestructorDecl>(m)) {
           mark = true;
         } else {
           mark = (m->isCopyAssignmentOperator() ||
@@ -86,6 +95,13 @@ public:
         if (mark) {
           /* Ensure the member is defined.  */
           sema.MarkFunctionReferenced(clang::SourceLocation(), m);
+          if (c && c->isDefaulted() && c->isDefaultConstructor() &&
+              c->isTrivial() && !c->isUsed(false) &&
+              !c->hasAttr<clang::DLLExportAttr>()) {
+            /* Clang does not build the definition of trivial constructors
+               until they are used.  Force semantic checking.  */
+            sema.DefineImplicitDefaultConstructor(clang::SourceLocation(), c);
+          }
           /* Finish implicitly instantiated member.  */
           sema.PerformPendingInstantiations();
         }
@@ -96,7 +112,9 @@ public:
   void HandleTagDeclDefinition(clang::TagDecl* d) {
     if(clang::CXXRecordDecl* rd = clang::dyn_cast<clang::CXXRecordDecl>(d)) {
       if(!rd->isDependentContext()) {
-        this->Classes.push(rd);
+        if (this->ClassImplicitMemberDepth < 16) {
+          this->Classes.push(Class(rd, this->ClassImplicitMemberDepth));
+        }
       }
     }
   }
@@ -113,9 +131,9 @@ public:
 
       // Add implicit members to classes.
       while (!this->Classes.empty()) {
-        clang::CXXRecordDecl* rd = this->Classes.front();
+        Class c = this->Classes.front();
         this->Classes.pop();
-        this->AddImplicitMembers(rd);
+        this->AddImplicitMembers(c);
       }
     }
 
@@ -204,6 +222,13 @@ protected:
         }
       }
 
+      // Prevent glibc use of a GNU extension not implemented by Clang.
+      if (this->NeedNoMathInlines(this->Opts.Predefines)) {
+        builtins += "\n"
+          "#define __NO_MATH_INLINES 1\n"
+          ;
+      }
+
     } else {
       builtins += predefines.substr(start, end-start);
     }
@@ -229,6 +254,13 @@ protected:
              pd.find("#define __ia64__ ") != pd.npos));
   }
 
+  bool NeedNoMathInlines(std::string const& pd) const {
+    return (this->IsActualGNU(pd) &&
+            (pd.find("#define __i386__ ") != pd.npos &&
+             pd.find("#define __OPTIMIZE__ ") != pd.npos &&
+             pd.find("#define __NO_MATH_INLINES ") == pd.npos));
+  }
+
   bool BeginSourceFileAction(clang::CompilerInstance& CI,
                              llvm::StringRef /*Filename*/) {
     CI.getPreprocessor().setPredefines(this->UpdatePredefines(CI));
@@ -306,14 +338,6 @@ static bool runClangCI(clang::CompilerInstance* CI, Options const& opts)
       std::cerr << MSG("Objective C");
       return false;
     }
-    if(CI->getLangOpts().C11) {
-      std::cerr << MSG("c11");
-      return false;
-    }
-    if(CI->getLangOpts().C99) {
-      std::cerr << MSG("c99");
-      return false;
-    }
 #   undef MSG
   }
 
diff --git a/src/Version.cmake b/src/Version.cmake
index 00b35e0..6fead5d 100644
--- a/src/Version.cmake
+++ b/src/Version.cmake
@@ -39,7 +39,7 @@ elseif(COMMAND _git)
       set(CastXML_VERSION "${CastXML_VERSION}-git")
     endif()
   endif()
-elseif("1489405" MATCHES "^([0-9a-f]+)$")
+elseif("b367e2d" MATCHES "^([0-9a-f]+)$")
   # Use version exported by 'git archive'.
   set(CastXML_VERSION "${CastXML_VERSION}-g${CMAKE_MATCH_1}")
 else()
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e13d308..65a5d7c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -49,6 +49,9 @@ macro(castxml_test_gccxml_common prefix ext std test)
   if("${std}" MATCHES "^gnu(.*)$")
     list(APPEND _castxml_expect ${prefix}.c${CMAKE_MATCH_1}.${test})
   endif()
+  if("${std}" MATCHES "^(c|gnu)[^+]")
+    list(APPEND _castxml_expect ${prefix}.c.${test})
+  endif()
   list(APPEND _castxml_expect ${prefix}.any.${test})
   set(command $<TARGET_FILE:castxml>
     --castxml-gccxml
@@ -73,10 +76,26 @@ macro(castxml_test_gccxml_c89 test)
   castxml_test_gccxml_common(gccxml c c89 ${test})
 endmacro()
 
+macro(castxml_test_gccxml_c99 test)
+  castxml_test_gccxml_common(gccxml c c99 ${test})
+endmacro()
+
+macro(castxml_test_gccxml_c11 test)
+  castxml_test_gccxml_common(gccxml c c11 ${test})
+endmacro()
+
 macro(castxml_test_gccxml_gnu89 test)
   castxml_test_gccxml_common(gccxml c gnu89 ${test})
 endmacro()
 
+macro(castxml_test_gccxml_gnu99 test)
+  castxml_test_gccxml_common(gccxml c gnu99 ${test})
+endmacro()
+
+macro(castxml_test_gccxml_gnu11 test)
+  castxml_test_gccxml_common(gccxml c gnu11 ${test})
+endmacro()
+
 macro(castxml_test_gccxml_cxx98 test)
   castxml_test_gccxml_common(gccxml cxx c++98 ${test})
 endmacro()
@@ -128,6 +147,10 @@ endmacro()
 macro(castxml_test_gccxml_c test)
   castxml_test_gccxml_c89(${test})
   castxml_test_gccxml_gnu89(${test})
+  castxml_test_gccxml_c99(${test})
+  castxml_test_gccxml_gnu99(${test})
+  castxml_test_gccxml_c11(${test})
+  castxml_test_gccxml_gnu11(${test})
 endmacro()
 
 macro(castxml_test_gccxml test)
@@ -205,6 +228,7 @@ castxml_test_cmd(cc-gnu-src-cxx-cmd --castxml-cc-gnu $<TARGET_FILE:cc-gnu> ${emp
 castxml_test_cmd(cc-gnu-tgt-amd64 --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__amd64__ ")" ${empty_cxx} "-###")
 castxml_test_cmd(cc-gnu-tgt-explicit --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> ")" -target explicit-target-triple ${empty_cxx} "-###")
 castxml_test_cmd(cc-gnu-tgt-i386 --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__i386__ ")" ${empty_cxx} "-###")
+castxml_test_cmd(cc-gnu-tgt-i386-opt-E --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__i386__ --cc-define=__OPTIMIZE__ ")" ${empty_cxx} -E -dM)
 castxml_test_cmd(cc-gnu-tgt-mingw --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=_WIN32 --cc-define=__MINGW32__ ")" ${empty_cxx} "-###")
 castxml_test_cmd(cc-gnu-tgt-win --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=_WIN32 ")" ${empty_cxx} "-###")
 castxml_test_cmd(cc-gnu-tgt-x86_64 --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__x86_64__ ")" ${empty_cxx} "-###")
@@ -224,6 +248,7 @@ castxml_test_cmd(cc-gnu-c-std-c11 --castxml-cc-gnu-c "(" $<TARGET_FILE:cc-gnu> -
 castxml_test_cmd(cc-gnu-c-std-gnu89 --castxml-cc-gnu-c "(" $<TARGET_FILE:cc-gnu>              ")" ${empty_c} "-###")
 castxml_test_cmd(cc-gnu-c-std-gnu99 --castxml-cc-gnu-c "(" $<TARGET_FILE:cc-gnu> -std=199901L ")" ${empty_c} "-###")
 castxml_test_cmd(cc-gnu-c-std-gnu11 --castxml-cc-gnu-c "(" $<TARGET_FILE:cc-gnu> -std=201112L ")" ${empty_c} "-###")
+castxml_test_cmd(cc-gnu-c-tgt-i386-opt-E --castxml-cc-gnu-c "(" $<TARGET_FILE:cc-gnu> --cc-define=__i386__ --cc-define=__OPTIMIZE__ ")" ${empty_c} -E -dM)
 
 # Test --castxml-cc-msvc detection.
 add_executable(cc-msvc cc-msvc.c)
@@ -262,11 +287,13 @@ castxml_test_gccxml(Class-implicit-member-access-mutable)
 castxml_test_gccxml(Class-implicit-member-array)
 castxml_test_gccxml(Class-implicit-member-bad-base)
 castxml_test_gccxml(Class-implicit-member-const)
+castxml_test_gccxml(Class-implicit-member-const-aggregate)
 castxml_test_gccxml(Class-implicit-member-reference)
 castxml_test_gccxml(Class-implicit-members)
 castxml_test_gccxml(Class-incomplete)
 castxml_test_gccxml(Class-incomplete-twice)
 castxml_test_gccxml(Class-member-template)
+castxml_test_gccxml(Class-member-template-access)
 castxml_test_gccxml(Class-partial-template-member-Typedef)
 castxml_test_gccxml(Class-template)
 castxml_test_gccxml(Class-template-Method-Argument-const)
@@ -278,6 +305,7 @@ castxml_test_gccxml(Class-template-friends)
 castxml_test_gccxml(Class-template-member-Typedef)
 castxml_test_gccxml(Class-template-member-Typedef-const)
 castxml_test_gccxml(Class-template-member-template)
+castxml_test_gccxml(Class-template-recurse)
 castxml_test_gccxml(Constructor)
 castxml_test_gccxml(Constructor-annotate)
 castxml_test_gccxml(Converter)
@@ -295,6 +323,8 @@ castxml_test_gccxml(Function-annotate)
 castxml_test_gccxml(Function-Argument-annotate)
 castxml_test_gccxml(Function-Argument-decay)
 castxml_test_gccxml(Function-Argument-default)
+castxml_test_gccxml(Function-Argument-default-cast)
+castxml_test_gccxml(Function-Argument-default-ns)
 castxml_test_gccxml(Function-rvalue-reference)
 castxml_test_gccxml(Function-template)
 castxml_test_gccxml(Function-throw)
@@ -305,6 +335,8 @@ castxml_test_gccxml(FundamentalType)
 castxml_test_gccxml(FundamentalTypes)
 castxml_test_gccxml(Method)
 castxml_test_gccxml(Method-annotate)
+castxml_test_gccxml(Method-Argument-default)
+castxml_test_gccxml(Method-Argument-default-cast)
 castxml_test_gccxml(Method-overrides)
 castxml_test_gccxml(Method-rvalue-reference)
 castxml_test_gccxml(MethodType)
@@ -345,6 +377,8 @@ castxml_test_gccxml(Variable)
 castxml_test_gccxml(Variable-annotate)
 castxml_test_gccxml(Variable-in-Class)
 castxml_test_gccxml(Variable-init)
+castxml_test_gccxml(Variable-init-cast)
+castxml_test_gccxml(Variable-init-ns)
 
 # Test multiple start declarations.
 set(castxml_test_gccxml_custom_input Namespace-nested)
diff --git a/test/expect/cmd.cc-gnu-c-tgt-i386-opt-E.stdout.txt b/test/expect/cmd.cc-gnu-c-tgt-i386-opt-E.stdout.txt
new file mode 100644
index 0000000..865095d
--- /dev/null
+++ b/test/expect/cmd.cc-gnu-c-tgt-i386-opt-E.stdout.txt
@@ -0,0 +1,11 @@
+^#define __GNUC_MINOR__ 1
+#define __GNUC__ 1
+#define __NO_MATH_INLINES 1
+#define __OPTIMIZE__ 1
+#define __builtin_va_arg_pack\(\) 0
+#define __builtin_va_arg_pack_len\(\) 1
+#define __castxml__ [0-9]+
+#define __castxml_clang_major__ [0-9]+
+#define __castxml_clang_minor__ [0-9]+
+#define __castxml_clang_patchlevel__ [0-9]+
+#define __i386__ 1$
diff --git a/test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt b/test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt
new file mode 100644
index 0000000..fa9c1e5
--- /dev/null
+++ b/test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt
@@ -0,0 +1,12 @@
+^#define __GNUC_MINOR__ 1
+#define __GNUC__ 1
+#define __NO_MATH_INLINES 1
+#define __OPTIMIZE__ 1
+#define __builtin_va_arg_pack\(\) 0
+#define __builtin_va_arg_pack_len\(\) 1
+#define __castxml__ [0-9]+
+#define __castxml_clang_major__ [0-9]+
+#define __castxml_clang_minor__ [0-9]+
+#define __castxml_clang_patchlevel__ [0-9]+
+#define __cplusplus 199711L
+#define __i386__ 1$
diff --git a/test/expect/cmd.gccxml-and-c11.stderr.txt b/test/expect/cmd.gccxml-and-c11.stderr.txt
deleted file mode 100644
index 16c8c53..0000000
--- a/test/expect/cmd.gccxml-and-c11.stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^error: '--castxml-gccxml' does not work with c11$
diff --git a/test/expect/cmd.gccxml-and-c99.result.txt b/test/expect/cmd.gccxml-and-c99.result.txt
deleted file mode 100644
index d00491f..0000000
--- a/test/expect/cmd.gccxml-and-c99.result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/test/expect/cmd.gccxml-and-c99.stderr.txt b/test/expect/cmd.gccxml-and-c99.stderr.txt
deleted file mode 100644
index 0f2887f..0000000
--- a/test/expect/cmd.gccxml-and-c99.stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^error: '--castxml-gccxml' does not work with c99$
diff --git a/test/expect/gccxml.any.Class-implicit-member-const-aggregate.xml.txt b/test/expect/gccxml.any.Class-implicit-member-const-aggregate.xml.txt
new file mode 100644
index 0000000..a6761b4
--- /dev/null
+++ b/test/expect/gccxml.any.Class-implicit-member-const-aggregate.xml.txt
@@ -0,0 +1,15 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Struct id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5" size="[0-9]+" align="[0-9]+"/>
+  <Field id="_3" name="data" type="_6c" context="_1" access="public" location="f1:2" file="f1" line="2" offset="0"/>
+  <Constructor id="_4" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+    <Argument type="_7" location="f1:1" file="f1" line="1"/>
+  </Constructor>
+  <Destructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+  <FundamentalType id="_6" name="int" size="[0-9]+" align="[0-9]+"/>
+  <CvQualifiedType id="_6c" type="_6" const="1"/>
+  <ReferenceType id="_7" type="_1c"/>
+  <CvQualifiedType id="_1c" type="_1" const="1"/>
+  <Namespace id="_2" name="::"/>
+  <File id="f1" name=".*/test/input/Class-implicit-member-const-aggregate.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Class-member-template-access.xml.txt b/test/expect/gccxml.any.Class-member-template-access.xml.txt
new file mode 100644
index 0000000..e2c0cd7
--- /dev/null
+++ b/test/expect/gccxml.any.Class-member-template-access.xml.txt
@@ -0,0 +1,29 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6 _7" size="[0-9]+" align="[0-9]+"/>
+  <Class id="_3" name="member<int>" context="_1" access="private" location="f1:4" file="f1" line="4" members="_8 _9 _10 _11" size="[0-9]+" align="[0-9]+"/>
+  <Constructor id="_4" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+  <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+    <Argument type="_12" location="f1:1" file="f1" line="1"/>
+  </Constructor>
+  <OperatorMethod id="_6" name="=" returns="_13" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+    <Argument type="_12" location="f1:1" file="f1" line="1"/>
+  </OperatorMethod>
+  <Destructor id="_7" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+  <Constructor id="_8" name="member" context="_3" access="public" location="f1:4" file="f1" line="4" inline="1" artificial="1"( throw="")?/>
+  <Constructor id="_9" name="member" context="_3" access="public" location="f1:4" file="f1" line="4" inline="1" artificial="1"( throw="")?>
+    <Argument type="_14" location="f1:4" file="f1" line="4"/>
+  </Constructor>
+  <OperatorMethod id="_10" name="=" returns="_15" context="_3" access="public" location="f1:4" file="f1" line="4" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+    <Argument type="_14" location="f1:4" file="f1" line="4"/>
+  </OperatorMethod>
+  <Destructor id="_11" name="member" context="_3" access="public" location="f1:4" file="f1" line="4" inline="1" artificial="1"( throw="")?/>
+  <ReferenceType id="_12" type="_1c"/>
+  <CvQualifiedType id="_1c" type="_1" const="1"/>
+  <ReferenceType id="_13" type="_1"/>
+  <ReferenceType id="_14" type="_3c"/>
+  <CvQualifiedType id="_3c" type="_3" const="1"/>
+  <ReferenceType id="_15" type="_3"/>
+  <Namespace id="_2" name="::"/>
+  <File id="f1" name=".*/test/input/Class-member-template-access.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Class-template-recurse.xml.txt b/test/expect/gccxml.any.Class-template-recurse.xml.txt
new file mode 100644
index 0000000..40106de
--- /dev/null
+++ b/test/expect/gccxml.any.Class-template-recurse.xml.txt
@@ -0,0 +1,18 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Variable id="_1" name="start" type="_2" init="" context="_3" location="f1:11" file="f1" line="11" mangled="[^"]+"/>
+  <Struct id="_2" name="C<void>" context="_3" location="f1:6" file="f1" line="6" members="_4 _5 _6 _7" size="[0-9]+" align="[0-9]+"/>
+  <Constructor id="_4" name="C" context="_2" access="public" location="f1:7" file="f1" line="7" inline="1"/>
+  <Constructor id="_5" name="C" context="_2" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")?>
+    <Argument type="_8" location="f1:6" file="f1" line="6"/>
+  </Constructor>
+  <OperatorMethod id="_6" name="=" returns="_9" context="_2" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+    <Argument type="_8" location="f1:6" file="f1" line="6"/>
+  </OperatorMethod>
+  <Destructor id="_7" name="C" context="_2" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")?/>
+  <ReferenceType id="_8" type="_2c"/>
+  <CvQualifiedType id="_2c" type="_2" const="1"/>
+  <ReferenceType id="_9" type="_2"/>
+  <Namespace id="_3" name="::"/>
+  <File id="f1" name=".*/test/input/Class-template-recurse.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Function-Argument-default-cast.xml.txt b/test/expect/gccxml.any.Function-Argument-default-cast.xml.txt
new file mode 100644
index 0000000..577adb1
--- /dev/null
+++ b/test/expect/gccxml.any.Function-Argument-default-cast.xml.txt
@@ -0,0 +1,48 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Namespace id="_1" name="start" context="_2" members="_3 _4 _5 _6 _7 _8"/>
+  <Struct id="_3" name="Base" context="_1" location="f1:2" file="f1" line="2" members="_9 _10 _11 _12" size="[0-9]+" align="[0-9]+"/>
+  <Struct id="_4" name="Derived" context="_1" location="f1:3" file="f1" line="3" members="_13 _14 _15 _16" bases="_3" size="[0-9]+" align="[0-9]+">
+    <Base type="_3" access="public" virtual="0" offset="0"/>
+  </Struct>
+  <Function id="_5" name="b" returns="_17" context="_1" location="f1:4" file="f1" line="4" mangled="[^"]+"/>
+  <Function id="_6" name="bc" returns="_18" context="_1" location="f1:5" file="f1" line="5" mangled="[^"]+"/>
+  <Typedef id="_7" name="Int" type="_19" context="_1" location="f1:6" file="f1" line="6"/>
+  <Function id="_8" name="f" returns="_20" context="_1" location="f1:7" file="f1" line="7" mangled="[^"]+">
+    <Argument type="_7" location="f1:7" file="f1" line="7" default="\(int\)0"/>
+    <Argument type="_17" location="f1:8" file="f1" line="8" default="\(start::Base \*\)0"/>
+    <Argument type="_17" location="f1:9" file="f1" line="9" default="static_cast<start::Base \*>\(0\)"/>
+    <Argument type="_17" location="f1:10" file="f1" line="10" default="reinterpret_cast<start::Base \*>\(0\)"/>
+    <Argument type="_17" location="f1:11" file="f1" line="11" default="const_cast<start::Base \*>\(start::bc\(\)\)"/>
+    <Argument type="_21" location="f1:12" file="f1" line="12" default="dynamic_cast<start::Derived \*>\(start::b\(\)\)"/>
+  </Function>
+  <Constructor id="_9" name="Base" context="_3" access="public" location="f1:2" file="f1" line="2"/>
+  <Destructor id="_10" name="Base" context="_3" access="public" location="f1:2" file="f1" line="2" virtual="1"/>
+  <OperatorMethod id="_11" name="=" returns="_22" context="_3" access="public" location="f1:2" file="f1" line="2" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+    <Argument type="_23" location="f1:2" file="f1" line="2"/>
+  </OperatorMethod>
+  <Constructor id="_12" name="Base" context="_3" access="public" location="f1:2" file="f1" line="2" inline="1" artificial="1"( throw="")?>
+    <Argument type="_23" location="f1:2" file="f1" line="2"/>
+  </Constructor>
+  <OperatorMethod id="_13" name="=" returns="_24" context="_4" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+    <Argument type="_25" location="f1:3" file="f1" line="3"/>
+  </OperatorMethod>
+  <Destructor id="_14" name="Derived" context="_4" access="public" location="f1:3" file="f1" line="3" virtual="1" inline="1" artificial="1"( throw="")? overrides="_10"/>
+  <Constructor id="_15" name="Derived" context="_4" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+  <Constructor id="_16" name="Derived" context="_4" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?>
+    <Argument type="_25" location="f1:3" file="f1" line="3"/>
+  </Constructor>
+  <PointerType id="_17" type="_3"/>
+  <PointerType id="_18" type="_3c"/>
+  <CvQualifiedType id="_3c" type="_3" const="1"/>
+  <FundamentalType id="_19" name="int" size="[0-9]+" align="[0-9]+"/>
+  <FundamentalType id="_20" name="void" size="[0-9]+" align="[0-9]+"/>
+  <PointerType id="_21" type="_4"/>
+  <ReferenceType id="_22" type="_3"/>
+  <ReferenceType id="_23" type="_3c"/>
+  <ReferenceType id="_24" type="_4"/>
+  <ReferenceType id="_25" type="_4c"/>
+  <CvQualifiedType id="_4c" type="_4" const="1"/>
+  <Namespace id="_2" name="::"/>
+  <File id="f1" name=".*/test/input/Function-Argument-default-cast.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Function-Argument-default-ns.xml.txt b/test/expect/gccxml.any.Function-Argument-default-ns.xml.txt
new file mode 100644
index 0000000..c6a3282
--- /dev/null
+++ b/test/expect/gccxml.any.Function-Argument-default-ns.xml.txt
@@ -0,0 +1,17 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Namespace id="_1" name="start" context="_2" members="_3 _4 _5"/>
+  <Variable id="_3" name="C" type="_6c" init="0" context="_1" location="f1:2" file="f1" line="2" static="1" mangled="[^"]+"/>
+  <Enumeration id="_4" name="" context="_1" location="f1:3" file="f1" line="3">
+    <EnumValue name="E" init="0"/>
+  </Enumeration>
+  <Function id="_5" name="f" returns="_7" context="_1" location="f1:4" file="f1" line="4" mangled="[^"]+">
+    <Argument type="_6" location="f1:4" file="f1" line="4" default="start::C"/>
+    <Argument type="_6" location="f1:4" file="f1" line="4" default="start::E"/>
+  </Function>
+  <FundamentalType id="_6" name="int" size="[0-9]+" align="[0-9]+"/>
+  <CvQualifiedType id="_6c" type="_6" const="1"/>
+  <FundamentalType id="_7" name="void" size="[0-9]+" align="[0-9]+"/>
+  <Namespace id="_2" name="::"/>
+  <File id="f1" name=".*/test/input/Function-Argument-default-ns.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Method-Argument-default-cast.xml.txt b/test/expect/gccxml.any.Method-Argument-default-cast.xml.txt
new file mode 100644
index 0000000..e7f93f2
--- /dev/null
+++ b/test/expect/gccxml.any.Method-Argument-default-cast.xml.txt
@@ -0,0 +1,27 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6 _7 _8 _9" size="[0-9]+" align="[0-9]+"/>
+  <Class id="_3" name="Class" context="_1" access="private" location="f1:2" file="f1" line="2" incomplete="1"/>
+  <Typedef id="_4" name="Int" type="_10" context="_1" access="private" location="f1:3" file="f1" line="3"/>
+  <Method id="_5" name="f" returns="_10" context="_1" access="private" location="f1:4" file="f1" line="4" mangled="[^"]+">
+    <Argument type="_4" location="f1:4" file="f1" line="4" default="\(int\)0"/>
+    <Argument type="_11" location="f1:5" file="f1" line="5" default="\(start::Class \*\)0"/>
+    <Argument type="_11" location="f1:6" file="f1" line="6" default="static_cast<start::Class \*>\(0\)"/>
+    <Argument type="_11" location="f1:7" file="f1" line="7" default="reinterpret_cast<start::Class \*>\(0\)"/>
+  </Method>
+  <Constructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+  <Constructor id="_7" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+    <Argument type="_12" location="f1:1" file="f1" line="1"/>
+  </Constructor>
+  <OperatorMethod id="_8" name="=" returns="_13" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+    <Argument type="_12" location="f1:1" file="f1" line="1"/>
+  </OperatorMethod>
+  <Destructor id="_9" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+  <FundamentalType id="_10" name="int" size="[0-9]+" align="[0-9]+"/>
+  <PointerType id="_11" type="_3"/>
+  <ReferenceType id="_12" type="_1c"/>
+  <CvQualifiedType id="_1c" type="_1" const="1"/>
+  <ReferenceType id="_13" type="_1"/>
+  <Namespace id="_2" name="::"/>
+  <File id="f1" name=".*/test/input/Method-Argument-default-cast.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Method-Argument-default.xml.txt b/test/expect/gccxml.any.Method-Argument-default.xml.txt
new file mode 100644
index 0000000..0e10cbf
--- /dev/null
+++ b/test/expect/gccxml.any.Method-Argument-default.xml.txt
@@ -0,0 +1,23 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6 _7 _8" size="[0-9]+" align="[0-9]+"/>
+  <Variable id="_3" name="C" type="_9c" init="0" context="_1" access="private" location="f1:2" file="f1" line="2" static="1" mangled="[^"]+"/>
+  <Method id="_4" name="method" returns="_9" context="_1" access="private" location="f1:3" file="f1" line="3" mangled="[^"]+">
+    <Argument type="_9" location="f1:3" file="f1" line="3" default="start::C"/>
+  </Method>
+  <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+  <Constructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+    <Argument type="_10" location="f1:1" file="f1" line="1"/>
+  </Constructor>
+  <OperatorMethod id="_7" name="=" returns="_11" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+    <Argument type="_10" location="f1:1" file="f1" line="1"/>
+  </OperatorMethod>
+  <Destructor id="_8" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+  <FundamentalType id="_9" name="int" size="[0-9]+" align="[0-9]+"/>
+  <CvQualifiedType id="_9c" type="_9" const="1"/>
+  <ReferenceType id="_10" type="_1c"/>
+  <CvQualifiedType id="_1c" type="_1" const="1"/>
+  <ReferenceType id="_11" type="_1"/>
+  <Namespace id="_2" name="::"/>
+  <File id="f1" name=".*/test/input/Method-Argument-default.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Variable-init-cast.xml.txt b/test/expect/gccxml.any.Variable-init-cast.xml.txt
new file mode 100644
index 0000000..4932570
--- /dev/null
+++ b/test/expect/gccxml.any.Variable-init-cast.xml.txt
@@ -0,0 +1,10 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Namespace id="_1" name="start" context="_2" members="_3 _4 _5"/>
+  <Typedef id="_3" name="Int" type="_6" context="_1" location="f1:2" file="f1" line="2"/>
+  <Variable id="_4" name="var_int" type="_6" init="\(int\)123" context="_1" location="f1:3" file="f1" line="3" mangled="[^"]+"/>
+  <Variable id="_5" name="var_int2" type="_6" init="static_cast<int>\(123\)" context="_1" location="f1:4" file="f1" line="4" mangled="[^"]+"/>
+  <FundamentalType id="_6" name="int" size="[0-9]+" align="[0-9]+"/>
+  <Namespace id="_2" name="::"/>
+  <File id="f1" name=".*/test/input/Variable-init-cast.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Variable-init-ns.xml.txt b/test/expect/gccxml.any.Variable-init-ns.xml.txt
new file mode 100644
index 0000000..30beee1
--- /dev/null
+++ b/test/expect/gccxml.any.Variable-init-ns.xml.txt
@@ -0,0 +1,10 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+  <Namespace id="_1" name="start" context="_2" members="_3 _4"/>
+  <Variable id="_3" name="C" type="_5c" init="123" context="_1" location="f1:2" file="f1" line="2" static="1" mangled="[^"]+"/>
+  <Variable id="_4" name="var_int" type="_5" init="start::C" context="_1" location="f1:3" file="f1" line="3" mangled="[^"]+"/>
+  <FundamentalType id="_5" name="int" size="[0-9]+" align="[0-9]+"/>
+  <CvQualifiedType id="_5c" type="_5" const="1"/>
+  <Namespace id="_2" name="::"/>
+  <File id="f1" name=".*/test/input/Variable-init-ns.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.c89.FunctionNoProto.xml.txt b/test/expect/gccxml.c.FunctionNoProto.xml.txt
similarity index 100%
rename from test/expect/gccxml.c89.FunctionNoProto.xml.txt
rename to test/expect/gccxml.c.FunctionNoProto.xml.txt
diff --git a/test/expect/gccxml.c89.FundamentalType.xml.txt b/test/expect/gccxml.c.FundamentalType.xml.txt
similarity index 100%
rename from test/expect/gccxml.c89.FundamentalType.xml.txt
rename to test/expect/gccxml.c.FundamentalType.xml.txt
diff --git a/test/expect/gccxml.c89.GNU-float128-nostart.xml.txt b/test/expect/gccxml.c.GNU-float128-nostart.xml.txt
similarity index 100%
rename from test/expect/gccxml.c89.GNU-float128-nostart.xml.txt
rename to test/expect/gccxml.c.GNU-float128-nostart.xml.txt
diff --git a/test/expect/gccxml.c89.GNU-float128.xml.txt b/test/expect/gccxml.c.GNU-float128.xml.txt
similarity index 100%
rename from test/expect/gccxml.c89.GNU-float128.xml.txt
rename to test/expect/gccxml.c.GNU-float128.xml.txt
diff --git a/test/expect/gccxml.c89.GNU-va_arg_pack.xml.txt b/test/expect/gccxml.c.GNU-va_arg_pack.xml.txt
similarity index 100%
rename from test/expect/gccxml.c89.GNU-va_arg_pack.xml.txt
rename to test/expect/gccxml.c.GNU-va_arg_pack.xml.txt
diff --git a/test/expect/gccxml.c89.Typedef-called-class.xml.txt b/test/expect/gccxml.c.Typedef-called-class.xml.txt
similarity index 100%
rename from test/expect/gccxml.c89.Typedef-called-class.xml.txt
rename to test/expect/gccxml.c.Typedef-called-class.xml.txt
diff --git a/test/expect/cmd.gccxml-and-c11.result.txt b/test/expect/gccxml.c.invalid.result.txt
similarity index 100%
rename from test/expect/cmd.gccxml-and-c11.result.txt
rename to test/expect/gccxml.c.invalid.result.txt
diff --git a/test/expect/gccxml.c89.invalid.stderr.txt b/test/expect/gccxml.c.invalid.stderr.txt
similarity index 100%
rename from test/expect/gccxml.c89.invalid.stderr.txt
rename to test/expect/gccxml.c.invalid.stderr.txt
diff --git a/test/expect/gccxml.c89.invalid.result.txt b/test/expect/gccxml.c89.invalid.result.txt
deleted file mode 100644
index d00491f..0000000
--- a/test/expect/gccxml.c89.invalid.result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/test/input/Class-implicit-member-const-aggregate.cxx b/test/input/Class-implicit-member-const-aggregate.cxx
new file mode 100644
index 0000000..76fc8a8
--- /dev/null
+++ b/test/input/Class-implicit-member-const-aggregate.cxx
@@ -0,0 +1,3 @@
+struct start {
+  int const data;
+};
diff --git a/test/input/Class-member-template-access.cxx b/test/input/Class-member-template-access.cxx
new file mode 100644
index 0000000..d05fe4b
--- /dev/null
+++ b/test/input/Class-member-template-access.cxx
@@ -0,0 +1,4 @@
+class start {
+  template <typename> class member {};
+};
+template class start::member<int>; // instantiation
diff --git a/test/input/Class-template-recurse.cxx b/test/input/Class-template-recurse.cxx
new file mode 100644
index 0000000..fd702a8
--- /dev/null
+++ b/test/input/Class-template-recurse.cxx
@@ -0,0 +1,11 @@
+template <typename T> struct A;
+template <typename T> struct C;
+template <typename T> struct B {
+  typedef C<T> type;
+};
+template <typename T> struct C {
+  C() {
+    static_cast<void>(sizeof(typename B< A<T> >::type));
+  }
+};
+C<void> start;
diff --git a/test/input/Function-Argument-default-cast.cxx b/test/input/Function-Argument-default-cast.cxx
new file mode 100644
index 0000000..09ff46b
--- /dev/null
+++ b/test/input/Function-Argument-default-cast.cxx
@@ -0,0 +1,13 @@
+namespace start {
+  struct Base { Base(); virtual ~Base(); };
+  struct Derived: public Base {};
+  Base* b();
+  Base const* bc();
+  typedef int Int;
+  void f(Int = (Int)0,
+         Base* = (Base*)0,
+         Base* = static_cast<Base*>(0),
+         Base* = reinterpret_cast<Base*>(0),
+         Base* = const_cast<Base*>(bc()),
+         Derived* = dynamic_cast<Derived*>(b()));
+}
diff --git a/test/input/Function-Argument-default-ns.cxx b/test/input/Function-Argument-default-ns.cxx
new file mode 100644
index 0000000..b2fc53e
--- /dev/null
+++ b/test/input/Function-Argument-default-ns.cxx
@@ -0,0 +1,5 @@
+namespace start {
+  static int const C = 0;
+  enum { E = 0 };
+  void f(int = C, int = E);
+}
diff --git a/test/input/Method-Argument-default-cast.cxx b/test/input/Method-Argument-default-cast.cxx
new file mode 100644
index 0000000..903b622
--- /dev/null
+++ b/test/input/Method-Argument-default-cast.cxx
@@ -0,0 +1,8 @@
+class start {
+  class Class;
+  typedef int Int;
+  int f(Int = (Int)0,
+        Class* = (Class*)0,
+        Class* = static_cast<Class*>(0),
+        Class* = reinterpret_cast<Class*>(0));
+};
diff --git a/test/input/Method-Argument-default.cxx b/test/input/Method-Argument-default.cxx
new file mode 100644
index 0000000..dfd86ae
--- /dev/null
+++ b/test/input/Method-Argument-default.cxx
@@ -0,0 +1,4 @@
+class start {
+  static int const C = 0;
+  int method(int = C);
+};
diff --git a/test/input/Variable-init-cast.cxx b/test/input/Variable-init-cast.cxx
new file mode 100644
index 0000000..80dbb0f
--- /dev/null
+++ b/test/input/Variable-init-cast.cxx
@@ -0,0 +1,5 @@
+namespace start {
+  typedef int Int;
+  int var_int = (Int)123;
+  int var_int2 = static_cast<Int>(123);
+}
diff --git a/test/input/Variable-init-ns.cxx b/test/input/Variable-init-ns.cxx
new file mode 100644
index 0000000..0f5311c
--- /dev/null
+++ b/test/input/Variable-init-ns.cxx
@@ -0,0 +1,4 @@
+namespace start {
+  static int const C = 123;
+  int var_int = C;
+}
diff --git a/test/run.cmake b/test/run.cmake
index e7b2c29..2b2c14e 100644
--- a/test/run.cmake
+++ b/test/run.cmake
@@ -90,8 +90,8 @@ if(msg)
   if("$ENV{TEST_UPDATE}" AND expect_xml_file AND EXISTS "${xml}")
     set(update_xml "${actual_xml}")
     string(REGEX REPLACE "^<\\?xml version=\"1.0\"\\?>" "^<\\\\?xml version=\"1.0\"\\\\?>" update_xml "${update_xml}")
+    string(REGEX REPLACE "([(*)])" "\\\\\\1" update_xml "${update_xml}")
     string(REGEX REPLACE "<GCC_XML[^>]*>" "<GCC_XML[^>]*>" update_xml "${update_xml}")
-    string(REGEX REPLACE "([()])" "\\\\\\1" update_xml "${update_xml}")
     string(REGEX REPLACE "mangled=\"[^\"]*\"" "mangled=\"[^\"]+\"" update_xml "${update_xml}")
     string(REGEX REPLACE "artificial=\"1\"( throw=\"\")?" "artificial=\"1\"( throw=\"\")?" update_xml "${update_xml}")
     string(REGEX REPLACE "size=\"[0-9]+\" align=\"[0-9]+\"" "size=\"[0-9]+\" align=\"[0-9]+\"" update_xml "${update_xml}")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/castxml.git



More information about the debian-med-commit mailing list