[llvm-bugs] [Bug 37352] New: /home/vegard/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp:44: const clang::IdentifierInfo* {anonymous}::findAnonymousUnionVarDeclName(const clang::VarDecl&): Assertion `RT && "type of VarDecl is expected to be RecordType."' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 7 07:46:14 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37352

            Bug ID: 37352
           Summary: /home/vegard/llvm/tools/clang/lib/AST/ItaniumCXXABI.cp
                    p:44: const clang::IdentifierInfo*
                    {anonymous}::findAnonymousUnionVarDeclName(const
                    clang::VarDecl&): Assertion `RT && "type of VarDecl is
                    expected to be RecordType."' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vegard.nossum at gmail.com
                CC: llvm-bugs at lists.llvm.org

Input:

struct A {
  A() {
    enum {} thread_local[] = {};
  }
};

Output:

$ clang++ -x c++ -c -
<stdin>:3:26: warning: ISO C++17 does not allow a decomposition group to be
empty [-Wempty-decomposition]
    enum {} thread_local[] = {};
                         ^
<stdin>:3:25: warning: decomposition declarations are a C++17 extension
[-Wc++17-extensions]
    enum {} thread_local[] = {};
                        ^~
<stdin>:3:13: error: decomposition declaration cannot be declared
'thread_local'
    enum {} thread_local[] = {};
            ^~~~~~~~~~~~
<stdin>:3:25: error: decomposition declaration cannot be declared with type
'enum (anonymous enum at <stdin>:3:5)'; declared type must be 'auto' or
reference
      to 'auto'
    enum {} thread_local[] = {};
                        ^
clang-7: /home/vegard/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp:44: const
clang::IdentifierInfo* {anonymous}::findAnonymousUnionVarDeclName(const
clang::VarDecl&): Assertion `RT && "type of VarDecl is expected to be
RecordType."' failed.
Stack dump:
0.      Program arguments: /home/vegard/llvm-build/bin/clang-7 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name -
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/home/vegard/creduce/-.gcno -resource-dir
/home/vegard/llvm-build/lib/clang/7.0.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++ -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/backward
-internal-isystem /usr/local/include -internal-isystem
/home/vegard/llvm-build/lib/clang/7.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/vegard/creduce -ferror-limit 19 -fmessage-length
159 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o -.o -x c++ - 
1.      <stdin>:3:28: current parser token '='
2.      <stdin>:1:1: parsing struct/union/class body 'A'
3.      <stdin>:2:7: parsing function body 'A::A'
4.      <stdin>:2:7: in compound statement ('{}')
#0 0x0000000008da8742 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/vegard/llvm/lib/Support/Unix/Signals.inc:403:0
#1 0x0000000008d9e6f2 llvm::sys::RunSignalHandlers()
/home/vegard/llvm/lib/Support/Signals.cpp:50:0
#2 0x0000000008d9eea9 SignalHandler(int)
/home/vegard/llvm/lib/Support/Unix/Signals.inc:243:0
#3 0x00007fc33e59c390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007fc33d307428 gsignal
/build/glibc-Cl5G7W/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007fc33d30902a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007fc33d2ffbd7 __assert_fail_base
/build/glibc-Cl5G7W/glibc-2.23/assert/assert.c:92:0
#7 0x00007fc33d2ffc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0000000011a3d0cf findAnonymousUnionVarDeclName
/home/vegard/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp:44:0
#9 0x0000000011a3d0cf (anonymous
namespace)::ItaniumNumberingContext::getManglingNumber(clang::VarDecl const*,
unsigned int) /home/vegard/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp:88:0
#10 0x000000000f921c18 clang::Sema::ActOnVariableDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&, llvm::ArrayRef<clang::BindingDecl*>)
/home/vegard/llvm/tools/clang/lib/Sema/SemaDecl.cpp:6877:0
#11 0x000000000fbb5cbf clang::Sema::ActOnDecompositionDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
/home/vegard/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp:834:0
#12 0x000000000f95d5c5 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
/home/vegard/llvm/tools/clang/lib/Sema/SemaDecl.cpp:5336:0
#13 0x000000000f9607c2 clang::Sema::ActOnDeclarator(clang::Scope*,
clang::Declarator&) /home/vegard/llvm/tools/clang/lib/Sema/SemaDecl.cpp:5194:0
#14 0x000000000ea1e373
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:2231:0
#15 0x000000000ea578c4 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:2045:0
#16 0x000000000ea60620
clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1768:0
#17 0x000000000ea61410
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1696:0
#18 0x000000000ebb9aed
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedConstructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:216:0
#19 0x000000000ebb9f7e
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedConstructsKind, clang::SourceLocation*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:111:0
#20 0x000000000ebc587f clang::Parser::ParseCompoundStatementBody(bool)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1003:0
#21 0x000000000ebccb40 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1975:0
#22 0x000000000e9eea4f clang::Token::isNot(clang::tok::TokenKind) const
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:551:0
#23 0x000000000e9eea4f
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:553:0
#24 0x000000000e9edf1e
llvm::SmallVectorTemplateCommon<clang::Parser::LateParsedDeclaration*,
void>::begin() const /home/vegard/llvm/include/llvm/ADT/SmallVector.h:118:0
#25 0x000000000e9edf1e
llvm::SmallVectorTemplateCommon<clang::Parser::LateParsedDeclaration*,
void>::size() const /home/vegard/llvm/include/llvm/ADT/SmallVector.h:136:0
#26 0x000000000e9edf1e
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:478:0
#27 0x000000000eaafd11
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) /home/vegard/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:3310:0
#28 0x000000000eab749d
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:1915:0
#29 0x000000000ea3e3a4
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:3675:0
#30 0x000000000e9cbe68
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:927:0
#31 0x000000000e9cdd91
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.168.constprop.192)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:1028:0
#32 0x000000000e9cded7
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:1030:0
#33 0x000000000e9dff74
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:853:0
#34 0x000000000e9e3529 _ZN5clang13AttributePoolD4Ev
/home/vegard/llvm/tools/clang/include/clang/Sema/AttributeList.h:642:0
#35 0x000000000e9e3529 _ZN5clang16ParsedAttributesD4Ev
/home/vegard/llvm/tools/clang/include/clang/Sema/AttributeList.h:755:0
#36 0x000000000e9e3529 _ZN5clang6Parser25ParsedAttributesWithRangeD4Ev
/home/vegard/llvm/tools/clang/include/clang/Parse/Parser.h:1308:0
#37 0x000000000e9e3529
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:606:0
#38 0x000000000e9e4e78
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:536:0
#39 0x000000000e9baa78 clang::ParseAST(clang::Sema&, bool, bool)
/home/vegard/llvm/tools/clang/lib/Parse/ParseAST.cpp:151:0
#40 0x000000000c01df2c clang::CodeGenAction::ExecuteAction()
/home/vegard/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1044:0
#41 0x000000000aecb7d6 clang::FrontendAction::Execute()
/home/vegard/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:904:0
#42 0x000000000ad5d2c8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/vegard/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:990:0
#43 0x000000000b2dc498
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/vegard/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:256:0
#44 0x0000000000e993f8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/vegard/llvm/tools/clang/tools/driver/cc1_main.cpp:222:0
#45 0x0000000000de2539 ExecuteCC1Tool
/home/vegard/llvm/tools/clang/tools/driver/driver.cpp:310:0
#46 0x0000000000de2539 main
/home/vegard/llvm/tools/clang/tools/driver/driver.cpp:382:0
#47 0x00007fc33d2f2830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#48 0x0000000000e7e1f9 _start (/home/vegard/llvm-build/bin/clang-7+0xe7e1f9)
clang-7: error: unable to execute command: Aborted
clang-7: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (https://github.com/llvm-mirror/clang
fd84b47426fa82c78ca25ba20cf37fc9b0f42586) (https://github.com/llvm-mirror/llvm
e1b4442d3ffc378f4a48dd0bfeb2b0876b116e2f)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180507/ac2b1e1d/attachment-0001.html>


More information about the llvm-bugs mailing list