[llvm-bugs] [Bug 49958] New: ICE in clang::RecordDecl::field_begin()

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 13 19:27:52 PDT 2021


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

            Bug ID: 49958
           Summary: ICE in clang::RecordDecl::field_begin()
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ldalessandro at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Code compiles without issue with gcc-10.3, so I assume this is valid code.

See attached preprocessed source.

****

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/bin/clang++ -DFMT_LOCALE
-I/home/ldalessa/open/ttl20/include
-I/home/ldalessa/open/ttl20/clang/_deps/ce-src/include
-I/home/ldalessa/open/ttl20/clang/_deps/eve-src/include
-I/home/ldalessa/open/ttl20/clang/_deps/fmt-src/include
-fconstexpr-backtrace-limit=0 -ferror-limit=1 -g -std=gnu++20 -o
CMakeFiles/test.dir/test.cpp.o -c /home/ldalessa/open/ttl20/tests/test.cpp 
1.      /home/ldalessa/open/ttl20/tests/test.cpp:20:42: current parser token
';'
2.      /home/ldalessa/open/ttl20/tests/test.cpp:19:1: parsing function body
'main'
3.      /home/ldalessa/open/ttl20/tests/test.cpp:19:1: in compound statement
('{}')
 #0 0x00007f6e1c43cf8f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbd0f8f)
 #1 0x00007f6e1c43b2f0 llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbcf2f0)
 #2 0x00007f6e1c43c6dd llvm::sys::CleanupOnSignal(unsigned long)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbd06dd)
 #3 0x00007f6e1c380dc0 (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb14dc0)
 #4 0x00007f6e23615140 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
 #5 0x00007f6e2154fa70 clang::RecordDecl::field_begin() const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xbe5a70)
 #6 0x00007f6e215ef0bd (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc850bd)
 #7 0x00007f6e215ee91b (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc8491b)
 #8 0x00007f6e215df468 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc75468)
 #9 0x00007f6e2160ce21 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca2e21)
#10 0x00007f6e215c88ca (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e8ca)
#11 0x00007f6e215e7909 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7d909)
#12 0x00007f6e215e6739 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7c739)
#13 0x00007f6e215cdae0 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc63ae0)
#14 0x00007f6e2160c665 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca2665)
#15 0x00007f6e215ef6b8 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc856b8)
#16 0x00007f6e215c88ca (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e8ca)
#17 0x00007f6e215f18f5 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc878f5)
#18 0x00007f6e215c88ca (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e8ca)
#19 0x00007f6e2162ad73 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xcc0d73)
#20 0x00007f6e2162a20f (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xcc020f)
#21 0x00007f6e215c9235 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5f235)
#22 0x00007f6e215e654e (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7c54e)
#23 0x00007f6e215e6739 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7c739)
#24 0x00007f6e21614fed (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xcaafed)
#25 0x00007f6e215cd5b4 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc635b4)
#26 0x00007f6e2160e54e (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca454e)
#27 0x00007f6e215c86d4 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e6d4)
#28 0x00007f6e2160f8b3 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca58b3)
#29 0x00007f6e215c8f29 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5ef29)
#30 0x00007f6e215ce413 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc64413)
#31 0x00007f6e215cd58e (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc6358e)
#32 0x00007f6e2160e54e (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca454e)
#33 0x00007f6e2160ef60 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca4f60)
#34 0x00007f6e215c86d4 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e6d4)
#35 0x00007f6e215e71f2 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7d1f2)
#36 0x00007f6e215e6739 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7c739)
#37 0x00007f6e215cdae0 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc63ae0)
#38 0x00007f6e21615bd8 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xcabbd8)
#39 0x00007f6e2160ef60 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca4f60)
#40 0x00007f6e215c86d4 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e6d4)
#41 0x00007f6e215e71f2 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7d1f2)
#42 0x00007f6e215e6739 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7c739)
#43 0x00007f6e215cdae0 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc63ae0)
#44 0x00007f6e21615bd8 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xcabbd8)
#45 0x00007f6e2160ef60 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca4f60)
#46 0x00007f6e215c86d4 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e6d4)
#47 0x00007f6e215e71f2 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7d1f2)
#48 0x00007f6e215e6739 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7c739)
#49 0x00007f6e215cdae0 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc63ae0)
#50 0x00007f6e21615bd8 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xcabbd8)
#51 0x00007f6e2160ef60 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca4f60)
#52 0x00007f6e215c86d4 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e6d4)
#53 0x00007f6e215e71f2 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7d1f2)
#54 0x00007f6e215e6739 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc7c739)
#55 0x00007f6e215cdae0 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc63ae0)
#56 0x00007f6e21615bd8 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xcabbd8)
#57 0x00007f6e2160ef60 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xca4f60)
#58 0x00007f6e215c86d4 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5e6d4)
#59 0x00007f6e215c9a05 clang::Expr::EvaluateAsInitializer(clang::APValue&,
clang::ASTContext const&, clang::VarDecl const*,
llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xc5fa05)
#60 0x00007f6e215495c3
clang::VarDecl::evaluateValue(llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xbdf5c3)
#61 0x00007f6e21549550 clang::VarDecl::evaluateValue() const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xbdf550)
#62 0x00007f6e21b3a128 clang::Sema::FinalizeVarWithDestructor(clang::VarDecl*,
clang::RecordType const*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x11d0128)
#63 0x00007f6e21a8bf85
clang::Sema::CheckCompleteVariableDeclaration(clang::VarDecl*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1121f85)
#64 0x00007f6e21a89b6f clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x111fb6f)
#65 0x00007f6e213564cb
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9ec4cb)
#66 0x00007f6e213542c9 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9ea2c9)
#67 0x00007f6e2134f9d9
clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*, clang::SourceLocation*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9e59d9)
#68 0x00007f6e2134f683
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9e5683)
#69 0x00007f6e213c42fe
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa5a2fe)
#70 0x00007f6e213c3e0e
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa59e0e)
#71 0x00007f6e213cac20 clang::Parser::ParseCompoundStatementBody(bool)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa60c20)
#72 0x00007f6e213cb9a5 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa619a5)
#73 0x00007f6e213e28a6
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa788a6)
#74 0x00007f6e213549b6 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9ea9b6)
#75 0x00007f6e213e1aad
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa77aad)
#76 0x00007f6e213e14bc
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa774bc)
#77 0x00007f6e213e0746
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa76746)
#78 0x00007f6e213dec9b
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa74c9b)
#79 0x00007f6e213416ed clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9d76ed)
#80 0x00007f6e2290d0c8 clang::FrontendAction::Execute()
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1fa30c8)
#81 0x00007f6e228c3641
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1f59641)
#82 0x00007f6e22973200
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x2009200)
#83 0x00000000004131bf cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang+++0x4131bf)
#84 0x00000000004115fe (/usr/bin/clang+++0x4115fe)
#85 0x00007f6e225f6732 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c8c732)
#86 0x00007f6e1c380bcd
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb14bcd)
#87 0x00007f6e225f5c5f
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c8bc5f)
#88 0x00007f6e225cda7f
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c63a7f)
#89 0x00007f6e225cdc27
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c63c27)
#90 0x00007f6e225e178c
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c7778c)
#91 0x00000000004110a3 main (/usr/bin/clang+++0x4110a3)
#92 0x00007f6e1b397d0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#93 0x000000000040e89a _start (/usr/bin/clang+++0x40e89a)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Debian clang version 11.0.1-2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/test-cb0e4c.cpp
clang: note: diagnostic msg: /tmp/test-cb0e4c.sh
clang: note: diagnostic msg:

-- 
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/20210414/15c8cc01/attachment-0001.html>


More information about the llvm-bugs mailing list