[cfe-dev] ASTImporter triggers assertions in some cases.

Nick La Rooy via cfe-dev cfe-dev at lists.llvm.org
Fri Jan 13 09:13:35 PST 2017


This patch seemed related so I gave it a try, but unfortunately the issue persists:

https://github.com/llvm-mirror/clang/commit/de0c61bab9ebf86a08a18b281fe018f3a5eed358


It might gives some clues as a to a fix though.


---------- Forwarded message ----------
From: Gaetano Checinski <gaetano.checinski at gmail.com<mailto:gaetano.checinski at gmail.com>>
Date: 2017-01-09 13:49 GMT+00:00
Subject: ASTImporter triggers assertions in some cases.
To: cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>


Hi Guys,
I've noticed that the ASTImporter fails to import some named decls from <iostream> due to an invalid linkagecache (in TagDecl::setTypedefNameForAnonDecl()).
Running with assertions disabled never terminates.
However, while trying to build an minimal reproducible example, i stumbled on a different error regarding templated structs with frienddecls.
I think they may be related because i found this commit:
https://public.cdl.uni-saarland.de/noise/clang/commit/ad0e27b18b0cefab049121d4bfd7b12216e7de6e<https://mailtrack.io/trace/link/3bfa5f729eac3d7d441cda522b04d9aa06778eec?url=https%3A%2F%2Fpublic.cdl.uni-saarland.de%2Fnoise%2Fclang%2Fcommit%2Fad0e27b18b0cefab049121d4bfd7b12216e7de6e&signature=1e3968956e628307>


The following test fails:

> // svn: E155007
> // unittests/AST/ASTImporterTest.cpp
> TEST(ImportExpr, TemplatedStructFriend) {
>  MatchVerifier<Decl> Verifier;
>  EXPECT_TRUE(testImport(
>  "void foo() {}; \n"
>  "inline namespace D {\n"
>  "  template<class>\n"
>  "  struct declToImport {\n"
>  "    friend bool f(const declToImport &);\n"
>  "  };\n"
>  "  template class declToImport<int>;\n"
>  "}\n", Lang_CXX, "", Lang_CXX, Verifier, decl()));
> }

stacktrace:
> clang/llvm/tools/clang/lib/AST/DeclFriend.cpp, line 43.
> 0  ASTTests                 0x0000000104f8e135 l
> lvm::sys::PrintStackTrace(llvm::raw_ostream&) + 101
> 1  ASTTests                 0x0000000104f8e779 PrintStackTraceSignalHandler(void*) + 25
> 2  ASTTests                 0x0000000104f8a6d9 llvm::sys::RunSignalHandlers() + 425
> 3  ASTTests                 0x0000000104f8ec92 SignalHandler(int) + 354
> 4  libsystem_platform.dylib 0x00007fff9e3eebba _sigtramp + 26

Thanks in advance,
Gaetano Checinski







[https://s3-eu-west-1.amazonaws.com/mailtrack-crx/icon-signature.png] Sent with Mailtrack<https://mailtrack.io/install?source=signature&lang=en&referral=gaetano.checinski@gmail.com&idSignature=22>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170113/90aab401/attachment.html>


More information about the cfe-dev mailing list