This is an automated email from the git hooks/post-receive script. gert-guest pushed a commit to branch master in repository castxml.
commit 593ae0e4f421db3a6f6a9d9db71349dea811623c Author: Gert Wollny <[email protected]> Date: Wed Jul 6 14:59:02 2016 +0000 Imported Upstream version 0.1+git20160706 --- README.rst | 3 +- src/Output.cxx | 49 +++++++-------- src/RunClang.cxx | 73 +++++++++++++++++++--- src/Utils.cxx | 11 ++++ src/Utils.h | 4 ++ src/Version.cmake | 2 +- test/CMakeLists.txt | 11 ++-- test/expect/cmd.cc-gnu-c-tgt-i386-opt-E.stdout.txt | 1 + test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt | 1 + test/expect/cmd.cc-msvc-builtin-1800-E.stdout.txt | 7 +++ test/expect/cmd.cc-msvc-builtin-1900-E.stdout.txt | 9 +++ ...gccxml.any.Class-member-template-access.xml.txt | 40 ++++++------ .../expect/gccxml.any.GNU-float128-nostart.xml.txt | 2 +- test/expect/gccxml.any.GNU-float128.xml.txt | 13 ++-- test/expect/gccxml.any.nostart.xml.txt | 10 +++ test/expect/gccxml.c.GNU-float128-nostart.xml.txt | 2 +- test/input/Class-member-template-access.cxx | 2 + .../{GNU-float128.c => GNU-float128-nostart.c} | 0 .../{GNU-float128.c => GNU-float128-nostart.cxx} | 0 test/input/GNU-float128.c | 1 + test/input/GNU-float128.cxx | 7 ++- test/input/make_integer_seq.cxx | 6 ++ test/input/nostart.cxx | 2 + 23 files changed, 186 insertions(+), 70 deletions(-) diff --git a/README.rst b/README.rst index 9e44ad2..075dce9 100644 --- a/README.rst +++ b/README.rst @@ -46,7 +46,8 @@ To build CastXML from source, first obtain the prerequisites: * `LLVM/Clang`_ compiler SDK install tree built using the C++ compiler. This version of CastXML has been tested with LLVM/Clang - - SVN revision ``245954`` + - SVN revision ``267153`` + - Release ``3.8`` - Release ``3.7`` - Release ``3.6`` diff --git a/src/Output.cxx b/src/Output.cxx index 2ec5d79..e16d9b9 100644 --- a/src/Output.cxx +++ b/src/Output.cxx @@ -809,6 +809,17 @@ void ASTVisitor::AddDeclContextMembers(clang::DeclContext const* dc, continue; } + // Skip declarations that we use internally as builtins. + if (isTranslationUnit) { + if (clang::NamedDecl const* nd = clang::dyn_cast<clang::NamedDecl>(d)) { + if (clang::IdentifierInfo const* ii = nd->getIdentifier()) { + if (ii->getName().find("__castxml") != std::string::npos) { + continue; + } + } + } + } + // Ignore certain members. switch (d->getKind()) { case clang::Decl::CXXRecord: { @@ -817,9 +828,6 @@ void ASTVisitor::AddDeclContextMembers(clang::DeclContext const* dc, if (rd->isInjectedClassName()) { continue; } - if (isTranslationUnit && rd->getName() == "__castxml__float128") { - continue; - } } break; case clang::Decl::AccessSpec: { continue; @@ -856,12 +864,6 @@ void ASTVisitor::AddDeclContextMembers(clang::DeclContext const* dc, continue; } } break; - case clang::Decl::Record: { - clang::RecordDecl const* rd = static_cast<clang::RecordDecl const*>(d); - if (isTranslationUnit && rd->getName() == "__castxml__float128") { - continue; - } - } break; case clang::Decl::Using: { continue; } break; @@ -1076,7 +1078,8 @@ void ASTVisitor::PrintIdAttribute(DumpNode const* dn) //---------------------------------------------------------------------------- void ASTVisitor::PrintNameAttribute(std::string const& name) { - this->OS << " name=\"" << encodeXML(name) << "\""; + std::string n = stringReplace(name, "__castxml__float128_s", "__float128"); + this->OS << " name=\"" << encodeXML(n) << "\""; } //---------------------------------------------------------------------------- @@ -1619,14 +1622,6 @@ void ASTVisitor::OutputNamespaceDecl( void ASTVisitor::OutputRecordDecl(clang::RecordDecl const* d, DumpNode const* dn) { - // As a special case, replace the Clang fake builtin for __float128 - // with a FundamentalType so we generate the same thing gccxml did. - if (this->CI.getLangOpts().CPlusPlus && - d == this->CI.getASTContext().getFloat128StubType()) { - this->PrintFloat128Type(dn); - return; - } - const char* tag; switch (d->getTagKind()) { case clang::TTK_Class: tag = "Class"; break; @@ -1647,15 +1642,13 @@ void ASTVisitor::OutputRecordDecl(clang::RecordDecl const* d, this->PrintNameAttribute(rso.str()); } clang::AccessSpecifier access = clang::AS_none; - if (dx) { - // If this is a template instantiation then get the access of the original + if (clang::ClassTemplateSpecializationDecl const* dxts = + clang::dyn_cast<clang::ClassTemplateSpecializationDecl>(d)) { + // This is a template instantiation so 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(); - } + if (clang::ClassTemplateDecl const* dxt = + dxts->getSpecializedTemplate()) { + access = dxt->getAccess(); } } this->PrintContextAttribute(d, access); @@ -1727,7 +1720,7 @@ void ASTVisitor::OutputTypedefDecl(clang::TypedefDecl const* d, { // As a special case, replace our compatibility Typedef for __float128 // with a FundamentalType so we generate the same thing gccxml did. - if (d->getName() == "__float128" && + if (d->getName() == "__castxml__float128" && clang::isa<clang::TranslationUnitDecl>(d->getDeclContext())) { clang::SourceLocation sl = d->getLocation(); if (sl.isValid()) { @@ -2104,7 +2097,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.137\">\n" + "<GCC_XML version=\"0.9.0\" cvs_revision=\"1.139\">\n" ; // Dump the complete nodes. diff --git a/src/RunClang.cxx b/src/RunClang.cxx index 515cf4f..03176a6 100644 --- a/src/RunClang.cxx +++ b/src/RunClang.cxx @@ -210,17 +210,70 @@ protected: // Provide __float128 if simulating the actual GNU compiler. if (this->NeedFloat128(this->Opts.Predefines)) { - // Clang provides its own (fake) builtin in gnu++11 mode. - // Otherwise we need to provide our own. - if (!(CI.getLangOpts().CPlusPlus11 && - CI.getLangOpts().GNUMode)) { - builtins += "\n" - "typedef struct __castxml__float128 { " - " char x[16] __attribute__((aligned(16))); " - "} __float128;\n" - ; - } + // Clang provides its own (fake) builtin in gnu++11 mode but issues + // diagnostics when it is used in some contexts. Provide our own + // approximation of the builtin instead. + builtins += "\n" + "typedef struct __castxml__float128_s { " + " char x[16] __attribute__((aligned(16))); " + "} __castxml__float128;\n" + "#define __float128 __castxml__float128\n" + ; + } + + // Provide __is_assignable builtin if simulating MSVC. + // When a future Clang version supports the builtin then + // we can skip this when built against such a Clang. + if (CI.getLangOpts().MSCompatibilityVersion >= 190000000 && + CI.getLangOpts().CPlusPlus11) { + builtins += "\n" + "template <typename T> T&& __castxml__declval() noexcept;\n" + "template <typename To, typename Fr, typename =\n" + " decltype(__castxml__declval<To>() = __castxml__declval<Fr>())>\n" + " static char (&__castxml__is_assignable_check(int))[1];\n" + "template <typename, typename>\n" + " static char (&__castxml__is_assignable_check(...))[2];\n" + "#define __is_assignable(_To,_Fr) \\\n" + " (sizeof(__castxml__is_assignable_check<_To,_Fr>(0)) == \\\n" + " sizeof(char(&)[1]))\n" + ; + } + +#if LLVM_VERSION_MAJOR < 3 \ + || LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 8 + // Clang 3.8 and above provide a __make_integer_seq builtin needed + // in C++14 mode. Provide it ourselves for older Clang versions. + if (CI.getLangOpts().CPlusPlus14) { + builtins += "\n" + "template <typename _T, _T> struct __castxml__integral_constant;\n" + "template <template<typename _U, _U...> class _S,\n" + " typename, typename, bool>\n" + " struct __castxml__make_integer_seq_impl;\n" + "template <template<typename _U, _U...> class _S,\n" + " class _T, _T... __v>\n" + " struct __castxml__make_integer_seq_impl<_S,\n" + " __castxml__integral_constant<_T, 0>,\n" + " _S<_T, __v...>, true> {\n" + " typedef _S<_T, __v...> type;\n" + " };\n" + "template <template<typename _U, _U...> class _S,\n" + " class _T, _T __i, _T... __v>\n" + " struct __castxml__make_integer_seq_impl<_S,\n" + " __castxml__integral_constant<_T, __i>,\n" + " _S<_T, __v...>, true>\n" + " : __castxml__make_integer_seq_impl<_S,\n" + " __castxml__integral_constant<_T, __i - 1>,\n" + " _S<_T, __i - 1, __v...>, __i >= 1 > {};\n" + "template <template<typename _U, _U...> class _S,\n" + " typename _T, _T _Sz>\n" + "using __castxml__make_integer_seq = typename\n" + " __castxml__make_integer_seq_impl<_S,\n" + " __castxml__integral_constant<_T, _Sz>,\n" + " _S<_T>, (_Sz>=0)>::type;\n" + "#define __make_integer_seq __castxml__make_integer_seq\n" + ; } +#endif // Prevent glibc use of a GNU extension not implemented by Clang. if (this->NeedNoMathInlines(this->Opts.Predefines)) { diff --git a/src/Utils.cxx b/src/Utils.cxx index 400b563..cea0655 100644 --- a/src/Utils.cxx +++ b/src/Utils.cxx @@ -214,6 +214,17 @@ std::string encodeXML(std::string const& in, bool cdata) return xml; } +//---------------------------------------------------------------------------- +std::string stringReplace(std::string str, std::string const& in, + std::string const& out) { + std::string::size_type p = 0; + while ((p = str.find(in, p)) != std::string::npos) { + str.replace(p, in.size(), out); + p += out.length(); + } + return str; +} + #if defined(_WIN32) # include <windows.h> #endif diff --git a/src/Utils.h b/src/Utils.h index 1baeb33..7103fa7 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -47,4 +47,8 @@ void suppressInteractiveErrors(); /// encodeXML - Convert character string to XML representation std::string encodeXML(std::string const& in, bool cdata = false); +/// stringReplace - Replace all occurrences of an 'in' string with 'out'. +std::string stringReplace(std::string str, std::string const& in, + std::string const& out); + #endif // CASTXML_UTILS_H diff --git a/src/Version.cmake b/src/Version.cmake index 6fead5d..fc93788 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("b367e2d" MATCHES "^([0-9a-f]+)$") +elseif("d5934bd" 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 65a5d7c..51da580 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -266,6 +266,9 @@ castxml_test_cmd(cc-msvc-std-c++98 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> castxml_test_cmd(cc-msvc-std-c++11 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1600 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-c++14 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1900 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-explicit --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1500 ")" -std=gnu++14 ${empty_cxx} "-###") +castxml_test_cmd(cc-msvc-builtin-1800-E --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1800 ")" ${empty_cxx} -E -dM) +castxml_test_cmd(cc-msvc-builtin-1900-E --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1900 ")" ${empty_cxx} -E -dM) +castxml_test_cmd(cc-msvc-builtin-1900 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1900 ")" ${input}/make_integer_seq.cxx) castxml_test_cmd(cc-msvc-c-bad-cmd --castxml-cc-msvc-c "(" cc-msvc-c-bad-cmd ")" ${empty_c}) castxml_test_cmd(cc-msvc-c-src-c-E --castxml-cc-msvc-c $<TARGET_FILE:cc-msvc> ${empty_c} -E -dM) castxml_test_cmd(cc-msvc-c-src-c-cmd --castxml-cc-msvc-c $<TARGET_FILE:cc-msvc> ${empty_c} "-###") @@ -397,6 +400,10 @@ castxml_test_gccxml(using-declaration-start) castxml_test_gccxml(using-directive-ns) castxml_test_gccxml(using-directive-start) +set(castxml_test_gccxml_custom_start "") +castxml_test_gccxml(nostart) +unset(castxml_test_gccxml_custom_start) + if(";${LLVM_TARGETS_TO_BUILD};" MATCHES ";X86;") set(castxml_test_gccxml_extra_arguments -target i386-pc-windows-msvc) castxml_test_gccxml(Function-calling-convention-ms) @@ -416,20 +423,16 @@ castxml_test_gccxml_broken(ReferenceType-to-Class-template) set(castxml_test_gccxml_extra_arguments --castxml-cc-gnu-c "(" $<TARGET_FILE:cc-gnu> --cc-define=__x86_64__ ")") castxml_test_gccxml_c(GNU-float128) -set(castxml_test_gccxml_custom_input GNU-float128) set(castxml_test_gccxml_custom_start "") castxml_test_gccxml_c(GNU-float128-nostart) unset(castxml_test_gccxml_custom_start) -unset(castxml_test_gccxml_custom_input) unset(castxml_test_gccxml_extra_arguments) set(castxml_test_gccxml_extra_arguments --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__x86_64__ ")") castxml_test_gccxml(GNU-float128) -set(castxml_test_gccxml_custom_input GNU-float128) set(castxml_test_gccxml_custom_start "") castxml_test_gccxml(GNU-float128-nostart) unset(castxml_test_gccxml_custom_start) -unset(castxml_test_gccxml_custom_input) unset(castxml_test_gccxml_extra_arguments) set(castxml_test_gccxml_extra_arguments --castxml-cc-gnu-c $<TARGET_FILE:cc-gnu>) 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 index 865095d..aac6988 100644 --- 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 @@ -8,4 +8,5 @@ #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ +#define __float128 __castxml__float128 #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 index fa9c1e5..2fbf8e5 100644 --- a/test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt +++ b/test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt @@ -9,4 +9,5 @@ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __cplusplus 199711L +#define __float128 __castxml__float128 #define __i386__ 1$ diff --git a/test/expect/cmd.cc-msvc-builtin-1800-E.stdout.txt b/test/expect/cmd.cc-msvc-builtin-1800-E.stdout.txt new file mode 100644 index 0000000..e4e6747 --- /dev/null +++ b/test/expect/cmd.cc-msvc-builtin-1800-E.stdout.txt @@ -0,0 +1,7 @@ +^#define _MSC_VER 1800 +#define _WIN32 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$ diff --git a/test/expect/cmd.cc-msvc-builtin-1900-E.stdout.txt b/test/expect/cmd.cc-msvc-builtin-1900-E.stdout.txt new file mode 100644 index 0000000..3990d4c --- /dev/null +++ b/test/expect/cmd.cc-msvc-builtin-1900-E.stdout.txt @@ -0,0 +1,9 @@ +^#define _MSC_VER 1900 +#define _WIN32 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 __is_assignable\(_To,_Fr\) \(sizeof\(__castxml__is_assignable_check<_To,_Fr>\(0\)\) == sizeof\(char\(&\)\[1\]\)\)( +#define __make_integer_seq __castxml__make_integer_seq)?$ diff --git a/test/expect/gccxml.any.Class-member-template-access.xml.txt b/test/expect/gccxml.any.Class-member-template-access.xml.txt index e2c0cd7..4c2a0fc 100644 --- a/test/expect/gccxml.any.Class-member-template-access.xml.txt +++ b/test/expect/gccxml.any.Class-member-template-access.xml.txt @@ -1,29 +1,31 @@ ^<\?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"/> + <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="member<char>" context="_1" access="private" location="f1:2" file="f1" line="2" incomplete="1"/> + <Class id="_4" name="member<int>" context="_1" access="private" location="f1:6" file="f1" line="6" members="_10 _11 _12 _13" size="[0-9]+" align="[0-9]+"/> + <Typedef id="_5" name="member_char" type="_3" context="_1" access="public" location="f1:4" file="f1" line="4"/> + <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="_14" 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 id="_8" name="=" returns="_15" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+"> + <Argument type="_14" 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"/> + <Destructor id="_9" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/> + <Constructor id="_10" name="member" context="_4" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")?/> + <Constructor id="_11" name="member" context="_4" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")?> + <Argument type="_16" location="f1:6" file="f1" line="6"/> </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 id="_12" name="=" returns="_17" context="_4" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")? mangled="[^"]+"> + <Argument type="_16" location="f1:6" file="f1" line="6"/> </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"/> + <Destructor id="_13" name="member" context="_4" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")?/> + <ReferenceType id="_14" 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"/> + <ReferenceType id="_15" type="_1"/> + <ReferenceType id="_16" type="_4c"/> + <CvQualifiedType id="_4c" type="_4" const="1"/> + <ReferenceType id="_17" type="_4"/> <Namespace id="_2" name="::"/> <File id="f1" name=".*/test/input/Class-member-template-access.cxx"/> </GCC_XML>$ diff --git a/test/expect/gccxml.any.GNU-float128-nostart.xml.txt b/test/expect/gccxml.any.GNU-float128-nostart.xml.txt index 826d133..1ff90f7 100644 --- a/test/expect/gccxml.any.GNU-float128-nostart.xml.txt +++ b/test/expect/gccxml.any.GNU-float128-nostart.xml.txt @@ -1,5 +1,5 @@ ^<\?xml version="1.0"\?> <GCC_XML[^>]*> .*<FundamentalType id="_[0-9]+" name="__float128" size="128" align="128"/>.* - <File id="f1" name=".*/test/input/GNU-float128.cxx"/> + <File id="f1" name=".*/test/input/GNU-float128-nostart.cxx"/> </GCC_XML>$ diff --git a/test/expect/gccxml.any.GNU-float128.xml.txt b/test/expect/gccxml.any.GNU-float128.xml.txt index c09de58..8ae15a6 100644 --- a/test/expect/gccxml.any.GNU-float128.xml.txt +++ b/test/expect/gccxml.any.GNU-float128.xml.txt @@ -1,9 +1,14 @@ ^<\?xml version="1.0"\?> <GCC_XML[^>]*> - <Function id="_1" name="start" returns="_2" context="_3" location="f1:1" file="f1" line="1" mangled=""> - <Argument type="_2" location="f1:1" file="f1" line="1"/> + <Namespace id="_1" name="start" context="_2" members="_3 _4 _5"/> + <Function id="_3" name="f" returns="_6" context="_1" location="f1:3" file="f1" line="3" mangled=""> + <Argument type="_6" location="f1:3" file="f1" line="3"/> </Function> - <FundamentalType id="_2" name="__float128" size="128" align="128"/> - <Namespace id="_3" name="::"/> + <Variable id="_4" name="v" type="_6" init="" context="_1" location="f1:4" file="f1" line="4" mangled="[^"]*"/> + <Variable id="_5" name="pa" type="_7" context="_1" location="f1:5" file="f1" line="5" mangled="[^"]*"/> + <FundamentalType id="_6" name="__float128" size="128" align="128"/> + <PointerType id="_7" type="_8"/> + <Namespace id="_2" name="::"/> + <Struct id="_8" name="A<__float128>" context="_2" location="f1:1" file="f1" line="1" incomplete="1"/> <File id="f1" name=".*/test/input/GNU-float128.cxx"/> </GCC_XML>$ diff --git a/test/expect/gccxml.any.nostart.xml.txt b/test/expect/gccxml.any.nostart.xml.txt new file mode 100644 index 0000000..37133fc --- /dev/null +++ b/test/expect/gccxml.any.nostart.xml.txt @@ -0,0 +1,10 @@ +^<\?xml version="1.0"\?> +<GCC_XML[^>]*> + <Namespace id="_1" name="::" members="[^"]*"/> +.*<Class id="_[0-9]+" name="A" context="_1" location="f1:1" file="f1" line="1" incomplete="1"/> + <OperatorFunction id="_[0-9]+" name="\+" returns="_[0-9]+" context="_1" location="f1:2" file="f1" line="2" mangled="[^"]*"> + <Argument type="_[0-9]+" location="f1:2" file="f1" line="2"/> + <Argument type="_[0-9]+" location="f1:2" file="f1" line="2"/> + </OperatorFunction>.* + <File id="f1" name=".*/test/input/nostart.cxx"/> +</GCC_XML>$ diff --git a/test/expect/gccxml.c.GNU-float128-nostart.xml.txt b/test/expect/gccxml.c.GNU-float128-nostart.xml.txt index 58d80c4..7d81e8c 100644 --- a/test/expect/gccxml.c.GNU-float128-nostart.xml.txt +++ b/test/expect/gccxml.c.GNU-float128-nostart.xml.txt @@ -1,5 +1,5 @@ ^<\?xml version="1.0"\?> <GCC_XML[^>]*> .*<FundamentalType id="_[0-9]+" name="__float128" size="128" align="128"/>.* - <File id="f1" name=".*/test/input/GNU-float128.c"/> + <File id="f1" name=".*/test/input/GNU-float128-nostart.c"/> </GCC_XML>$ diff --git a/test/input/Class-member-template-access.cxx b/test/input/Class-member-template-access.cxx index d05fe4b..1bcead7 100644 --- a/test/input/Class-member-template-access.cxx +++ b/test/input/Class-member-template-access.cxx @@ -1,4 +1,6 @@ class start { template <typename> class member {}; +public: + typedef member<char> member_char; // incomplete }; template class start::member<int>; // instantiation diff --git a/test/input/GNU-float128.c b/test/input/GNU-float128-nostart.c similarity index 100% copy from test/input/GNU-float128.c copy to test/input/GNU-float128-nostart.c diff --git a/test/input/GNU-float128.c b/test/input/GNU-float128-nostart.cxx similarity index 100% copy from test/input/GNU-float128.c copy to test/input/GNU-float128-nostart.cxx diff --git a/test/input/GNU-float128.c b/test/input/GNU-float128.c index fbb07e1..ca848df 100644 --- a/test/input/GNU-float128.c +++ b/test/input/GNU-float128.c @@ -1 +1,2 @@ __float128 start(__float128); +__float128 v; diff --git a/test/input/GNU-float128.cxx b/test/input/GNU-float128.cxx index fbb07e1..183ada9 100644 --- a/test/input/GNU-float128.cxx +++ b/test/input/GNU-float128.cxx @@ -1 +1,6 @@ -__float128 start(__float128); +template <typename T> struct A; +namespace start { + __float128 f(__float128); + __float128 v; + A<__float128>* pa; +} diff --git a/test/input/make_integer_seq.cxx b/test/input/make_integer_seq.cxx new file mode 100644 index 0000000..44a89a8 --- /dev/null +++ b/test/input/make_integer_seq.cxx @@ -0,0 +1,6 @@ +template <typename _T, _T...> struct seq; +typedef __make_integer_seq<seq, int, 3> seq_A; +typedef seq<int,0,1,2> seq_B; +template <typename A, typename B> struct assert_same; +template <typename A> struct assert_same<A,A> {}; +assert_same<seq_A,seq_B> enforce; diff --git a/test/input/nostart.cxx b/test/input/nostart.cxx new file mode 100644 index 0000000..37374bc --- /dev/null +++ b/test/input/nostart.cxx @@ -0,0 +1,2 @@ +class A; +A operator+(A,A); -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/castxml.git _______________________________________________ debian-med-commit mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit
