Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Concepts] ICE on syntax error, in ConvertConstrainedAutoDeclSpecToType #47937

Closed
Quuxplusone opened this issue Dec 24, 2020 · 6 comments
Closed
Assignees
Labels
bugzilla Issues migrated from bugzilla c++20

Comments

@Quuxplusone
Copy link
Contributor

Bugzilla Link 48593
Resolution FIXED
Resolved on Mar 12, 2021 16:30
Version trunk
OS All
CC @mizvekov,@zygoloid

Extended Description

// https://godbolt.org/z/8Tb4aa
template concept C = true;
C<,> x

Originally reported by Leander Behr on the cpplang slack.

:3:3: error: expected expression C<,> x ^ :3:1: error: expected 'auto' or 'decltype(auto)' after concept name C<,> x ^ auto 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-11.0.0/bin/clang++ -g -o ./output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-10.2.0 -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 -O3 1. parser at end of file #​0 0x0000556f4e0b547a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x2cab47a) #​1 0x0000556f4e0b3224 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x2ca9224) #​2 0x0000556f4e0b3495 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x2ca9495) #​3 0x0000556f4e027cc0 CrashRecoverySignalHandler(int) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x2c1dcc0) #​4 0x00007f672cfc23c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0) #​5 0x0000556f50373f5b ConvertConstrainedAutoDeclSpecToType(clang::Sema&, clang::DeclSpec&, clang::AutoTypeKeyword) (.isra.674) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x4f69f5b) #​6 0x0000556f50389932 GetDeclSpecTypeForDeclarator((anonymous namespace)::TypeProcessingState&, clang::TypeSourceInfo*&) (.constprop.1044) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x4f7f932) #​7 0x0000556f50396e53 clang::Sema::GetTypeForDeclarator(clang::Declarator&, clang::Scope*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x4f8ce53) #​8 0x0000556f4fe378ee clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x4a2d8ee) #​9 0x0000556f4fe38569 clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x4a2e569) #​10 0x0000556f4fc07d70 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x47fdd70) #​11 0x0000556f4fc0e705 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x4804705) #​12 0x0000556f4fbf0df9 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x47e6df9) #​13 0x0000556f4fbf1af1 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.228) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x47e7af1) #​14 0x0000556f4fbf79c9 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x47ed9c9) #​15 0x0000556f4fbf90d9 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&, bool) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x47ef0d9) #​16 0x0000556f4fbecd19 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x47e2d19) #​17 0x0000556f4e8a1479 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x3497479) #​18 0x0000556f4e85af9b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x3450f9b) #​19 0x0000556f4e967b2b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x355db2b) #​20 0x0000556f4c29014c cc1_main(llvm::ArrayRef, char const*, void*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0xe8614c) #​21 0x0000556f4c28cc4d ExecuteCC1Tool(llvm::SmallVectorImpl&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0xe82c4d) #​22 0x0000556f4e732c45 void llvm::function_ref::callback_fn >, std::__cxx11::basic_string, std::allocator >*, bool*) const::'lambda'()>(long) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x3328c45) #​23 0x0000556f4e027da3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x2c1dda3) #​24 0x0000556f4e733720 clang::driver::CC1Command::Execute(llvm::ArrayRef >, std::__cxx11::basic_string, std::allocator >*, bool*) const (.part.148) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x3329720) #​25 0x0000556f4e70d8f5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x33038f5) #​26 0x0000556f4e70e33f clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl >&) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x330433f) #​27 0x0000556f4e716ed5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl >&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0x330ced5) #​28 0x0000556f4c1ccdc1 main (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0xdc2dc1) #​29 0x00007f672ca730b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b3) #​30 0x0000556f4c28c7ca _start (/opt/compiler-explorer/clang-11.0.0/bin/clang+++0xe827ca)
@Quuxplusone
Copy link
Contributor Author

assigned to @mizvekov

@mizvekov
Copy link
Contributor

mizvekov commented Feb 5, 2021

Might be the same bug, slightly different stack trace:

clang++-11 -std=c++20 -fsyntax-only -fno-crash-diagnostics test.cc

template <class T, class U> concept b = requires { true; };
b<c> auto d = 0;

===>

test.cc:2:3: error: use of undeclared identifier 'c'
b<c> auto d = 0;
  ^
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: clang++-11 -std=c++20 -fsyntax-only -fno-crash-diagnostics test.cc
1.      test.cc:2:13: current parser token '='
 #&#8203;0 0x00007f733b140f8f llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbd0f8f)
 #&#8203;1 0x00007f733b13f2f0 llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbcf2f0)
 #&#8203;2 0x00007f733b1406dd llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbd06dd)
 #&#8203;3 0x00007f733b084dc0 (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb14dc0)
 #&#8203;4 0x00007f7342329140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
 #&#8203;5 0x00007f7340cb22c6 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x16422c6)
 #&#8203;6 0x00007f7340c9db6b (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x162db6b)
 #&#8203;7 0x00007f7340c9cf48 clang::Sema::GetTypeForDeclarator(clang::Declarator&, clang::Scope*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x162cf48)
 #&#8203;8 0x00007f7340772117 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1102117)
 #&#8203;9 0x00007f7340771888 clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1101888)
#&#8203;10 0x00007f734005b680 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9eb680)
#&#8203;11 0x00007f734005a2c9 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9ea2c9)
#&#8203;12 0x00007f73400e7aad clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa77aad)
#&#8203;13 0x00007f73400e74bc clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa774bc)
#&#8203;14 0x00007f73400e6746 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa76746)
#&#8203;15 0x00007f73400e4c9b clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0xa74c9b)
#&#8203;16 0x00007f73400476ed clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9d76ed)
#&#8203;17 0x00007f73416130c8 clang::FrontendAction::Execute() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1fa30c8)
#&#8203;18 0x00007f73415c9641 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1f59641)
#&#8203;19 0x00007f7341679200 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x2009200)
#&#8203;20 0x00000000004131bf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-11/bin/clang+0x4131bf)
#&#8203;21 0x00000000004115fe (/usr/lib/llvm-11/bin/clang+0x4115fe)
#&#8203;22 0x00007f73412fc732 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c8c732)
#&#8203;23 0x00007f733b084bcd llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb14bcd)
#&#8203;24 0x00007f73412fbc5f 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)
#&#8203;25 0x00007f73412d3a7f clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c63a7f)
#&#8203;26 0x00007f73412d3c27 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)
#&#8203;27 0x00007f73412e778c 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)
#&#8203;28 0x00000000004110a3 main (/usr/lib/llvm-11/bin/clang+0x4110a3)
#&#8203;29 0x00007f733a086d0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#&#8203;30 0x000000000040e89a _start (/usr/lib/llvm-11/bin/clang+0x40e89a)
clang: error: clang frontend command failed due to signal (use -v to see invocation)

@mizvekov
Copy link
Contributor

mizvekov commented Mar 1, 2021

*** Bug llvm/llvm-bugzilla-archive#48601 has been marked as a duplicate of this bug. ***

@mizvekov
Copy link
Contributor

mizvekov commented Mar 6, 2021

This is fixed by https://reviews.llvm.org/D98095

@mizvekov
Copy link
Contributor

Patch has landed: d4a8c73

@mizvekov
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#48601

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++20
Projects
None yet
Development

No branches or pull requests

2 participants