[llvm-bugs] [Bug 49061] New: Crash compiling compound statements

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 5 11:45:18 PST 2021


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

            Bug ID: 49061
           Summary: Crash compiling compound statements
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: leni536 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

__Summary__

Compound statements in default function parameters in lambda expression and in
default member initializers crash the compiler.

__Version__

clang version 13.0.0 (https://github.com/llvm/llvm-project.git
16fb1c7aaeba9a7f22e4dcc8761b1cbf1fe524c1)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-trunk/bin
Compiler returned: 0

__Examples__

command line arguments: -std=c++17

Example 1:

void foo() {
    [](int i = ({return; 1;})){};
}

https://godbolt.org/z/4z8aM3

Example 2:

void foo() {
    struct S {
        int i;
        int j = ({i;});
    };
}

https://godbolt.org/z/49Wqov

__Output__

Output 1:

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: /opt/compiler-explorer/clang-trunk/bin/clang++ -g -o
./output.s -mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics
-fno-crash-diagnostics -std=c++17 <source>
1.      <source>:2:24: current parser token ';'
2.      <source>:1:12: parsing function body 'foo'
3.      <source>:1:12: in compound statement ('{}')
4.      <source>:2:5: lambda expression parsing
5.      <source>:2:17: in compound statement ('{}')
 #0 0x000055f805242e1c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3016e1c)
 #1 0x000055f805240bc4 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3014bc4)
 #2 0x000055f805240e45 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3014e45)
 #3 0x000055f8051a7cf8 CrashRecoverySignalHandler(int)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2f7bcf8)
 #4 0x00007f954bd2c3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #5 0x000055f8074c7457
clang::Sema::ActOnCapScopeReturnStmt(clang::SourceLocation, clang::Expr*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x529b457)
 #6 0x000055f8074c7e7f clang::Sema::BuildReturnStmt(clang::SourceLocation,
clang::Expr*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x529be7f)
 #7 0x000055f8074c8de2 clang::Sema::ActOnReturnStmt(clang::SourceLocation,
clang::Expr*, clang::Scope*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x529cde2)
 #8 0x000055f806f11975 clang::Parser::ParseReturnStatement()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce5975)
 #9 0x000055f806f149ef
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce89ef)
#10 0x000055f806f14f79
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce8f79)
#11 0x000055f806f15a71 clang::Parser::ParseCompoundStatementBody(bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce9a71)
#12 0x000055f806f1624e clang::Parser::ParseCompoundStatement(bool, unsigned
int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4cea24e)
#13 0x000055f806ec218e
clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool,
bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c9618e)
#14 0x000055f806eb9d6e
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c8dd6e)
#15 0x000055f806ebc056
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c90056)
#16 0x000055f806ebd214
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c91214)
#17 0x000055f806e9c596
clang::Parser::ParseParameterDeclarationClause(clang::DeclaratorContext,
clang::ParsedAttributes&,
llvm::SmallVectorImpl<clang::DeclaratorChunk::ParamInfo>&,
clang::SourceLocation&) (.part.359)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c70596)
#18 0x000055f806e9ccf5
clang::Parser::ParseParameterDeclarationClause(clang::DeclaratorContext,
clang::ParsedAttributes&,
llvm::SmallVectorImpl<clang::DeclaratorChunk::ParamInfo>&,
clang::SourceLocation&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c70cf5)
#19 0x000055f806ed183f
clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ca583f)
#20 0x000055f806ed25c3 clang::Parser::ParseLambdaExpression()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ca65c3)
#21 0x000055f806ebac23
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c8ec23)
#22 0x000055f806ebc056
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c90056)
#23 0x000055f806ebd214
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c91214)
#24 0x000055f806ebdec9
clang::Parser::ParseExpression(clang::Parser::TypeCastState)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c91ec9)
#25 0x000055f806f1cadd
clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4cf0add)
#26 0x000055f806f14c9b
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce8c9b)
#27 0x000055f806f14f79
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce8f79)
#28 0x000055f806f15a71 clang::Parser::ParseCompoundStatementBody(bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce9a71)
#29 0x000055f806f19293 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ced293)
#30 0x000055f806e71317
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c45317)
#31 0x000055f806e998f5 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c6d8f5)
#32 0x000055f806e6ca71
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c40a71)
#33 0x000055f806e6d1a1
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.241)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c411a1)
#34 0x000055f806e73129
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c47129)
#35 0x000055f806e746a9
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c486a9)
#36 0x000055f806e74c95
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c48c95)
#37 0x000055f806e678d3 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c3b8d3)
#38 0x000055f8060a6dd2 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e7add2)
#39 0x000055f805aa7291 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x387b291)
#40 0x000055f805a4a313
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x381e313)
#41 0x000055f805b6f443
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3943443)
#42 0x000055f803209fdc cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xfddfdc)
#43 0x000055f8032060fd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xfda0fd)
#44 0x000055f805902cd5 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36d6cd5)
#45 0x000055f8051a7dd3
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2f7bdd3)
#46 0x000055f805903608
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.165)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36d7608)
#47 0x000055f8058dcf49
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36b0f49)
#48 0x000055f8058de16f
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36b216f)
#49 0x000055f8058eda85
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36c1a85)
#50 0x000055f803123c74 main
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xef7c74)
#51 0x00007f954b7dd0b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#52 0x000055f803205c7a _start
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xfd9c7a)
clang-13: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
Compiler returned: 139

Output 2:

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: /opt/compiler-explorer/clang-trunk/bin/clang++ -g -o
./output.s -mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics
-fno-crash-diagnostics -std=c++17 <source>
1.      <source>:4:19: at annotation token
2.      <source>:1:12: parsing function body 'foo'
3.      <source>:1:12: in compound statement ('{}')
4.      <source>:2:5: parsing struct/union/class body 'S'
5.      <source>:4:18: in compound statement ('{}')
 #0 0x0000557baa9f1e1c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3016e1c)
 #1 0x0000557baa9efbc4 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3014bc4)
 #2 0x0000557baa9efe45 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3014e45)
 #3 0x0000557baa956cf8 CrashRecoverySignalHandler(int)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2f7bcf8)
 #4 0x00007fb4788493c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #5 0x0000557bacae8751
clang::Sema::BuildPossibleImplicitMemberExpr(clang::CXXScopeSpec const&,
clang::SourceLocation, clang::LookupResult&, clang::TemplateArgumentListInfo
const*, clang::Scope const*, clang::UnresolvedLookupExpr*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x510d751)
 #6 0x0000557bac84261d
clang::Sema::ActOnNameClassifiedAsOverloadSet(clang::Scope*, clang::Expr*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4e6761d)
 #7 0x0000557bac66abe6
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c8fbe6)
 #8 0x0000557bac66b056
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c90056)
 #9 0x0000557bac66c214
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c91214)
#10 0x0000557bac66cec9
clang::Parser::ParseExpression(clang::Parser::TypeCastState)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c91ec9)
#11 0x0000557bac6cbadd
clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4cf0add)
#12 0x0000557bac6c3c9b
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce8c9b)
#13 0x0000557bac6c3f79
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce8f79)
#14 0x0000557bac6c4a71 clang::Parser::ParseCompoundStatementBody(bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce9a71)
#15 0x0000557bac6c524e clang::Parser::ParseCompoundStatement(bool, unsigned
int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4cea24e)
#16 0x0000557bac67118e
clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool,
bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c9618e)
#17 0x0000557bac668d6e
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c8dd6e)
#18 0x0000557bac66b056
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c90056)
#19 0x0000557bac66c214
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c91214)
#20 0x0000557bac65145f clang::Parser::ParseCXXMemberInitializer(clang::Decl*,
bool, clang::SourceLocation&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c7645f)
#21 0x0000557bac627bd0
clang::Parser::ParseLexedMemberInitializer(clang::Parser::LateParsedMemberInitializer&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c4cbd0)
#22 0x0000557bac627905
clang::Parser::ParseLexedMemberInitializers(clang::Parser::ParsingClass&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c4c905)
#23 0x0000557bac660c2d
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c85c2d)
#24 0x0000557bac662c2b
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c87c2b)
#25 0x0000557bac643be2
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c68be2)
#26 0x0000557bac64957d
clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*, clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c6e57d)
#27 0x0000557bac6498f2
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c6e8f2)
#28 0x0000557bac6c3e03
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce8e03)
#29 0x0000557bac6c3f79
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce8f79)
#30 0x0000557bac6c4a71 clang::Parser::ParseCompoundStatementBody(bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ce9a71)
#31 0x0000557bac6c8293 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4ced293)
#32 0x0000557bac620317
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c45317)
#33 0x0000557bac6488f5 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c6d8f5)
#34 0x0000557bac61ba71
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c40a71)
#35 0x0000557bac61c1a1
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.241)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c411a1)
#36 0x0000557bac622129
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c47129)
#37 0x0000557bac6236a9
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c486a9)
#38 0x0000557bac623c95
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c48c95)
#39 0x0000557bac6168d3 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c3b8d3)
#40 0x0000557bab855dd2 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e7add2)
#41 0x0000557bab256291 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x387b291)
#42 0x0000557bab1f9313
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x381e313)
#43 0x0000557bab31e443
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3943443)
#44 0x0000557ba89b8fdc cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xfddfdc)
#45 0x0000557ba89b50fd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xfda0fd)
#46 0x0000557bab0b1cd5 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36d6cd5)
#47 0x0000557baa956dd3
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2f7bdd3)
#48 0x0000557bab0b2608
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.165)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36d7608)
#49 0x0000557bab08bf49
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36b0f49)
#50 0x0000557bab08d16f
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36b216f)
#51 0x0000557bab09ca85
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x36c1a85)
#52 0x0000557ba88d2c74 main
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xef7c74)
#53 0x00007fb4782fa0b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#54 0x0000557ba89b4c7a _start
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xfd9c7a)
clang-13: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
Compiler returned: 139

__Remarks__

g++ accepts the first example and rejects the second one.

-- 
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/20210205/3bf1cad5/attachment-0001.html>


More information about the llvm-bugs mailing list