[llvm-bugs] [Bug 49107] New: clang crashes on invalid code with concepts

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 9 01:11:43 PST 2021


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

            Bug ID: 49107
           Summary: clang crashes on invalid code with concepts
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hokein at google.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

code:

```
template<typename From, typename To>
concept A = true;

void foo(A<Inexistent> auto p);
```

$ ./bin/clang -cc1 -ast-dump /tmp/t.cpp -std=c++2a
$ /tmp/t.cpp:4:30: current parser token ')'
  llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
workspace/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:13
  llvm::sys::RunSignalHandlers()
workspace/llvm-project/llvm/lib/Support/Signals.cpp:72:18
  SignalHandler(int)
workspace/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
  __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
  ConvertConstrainedAutoDeclSpecToType(clang::Sema&, clang::DeclSpec&,
clang::AutoTypeKeyword)
workspace/llvm-project/clang/lib/Sema/SemaType.cpp:1264:33
  ConvertDeclSpecToType((anonymous namespace)::TypeProcessingState&)
workspace/llvm-project/clang/lib/Sema/SemaType.cpp:0:0
  GetDeclSpecTypeForDeclarator((anonymous namespace)::TypeProcessingState&,
clang::TypeSourceInfo*&)
workspace/llvm-project/clang/lib/Sema/SemaType.cpp:3279:7
  clang::Sema::GetTypeForDeclarator(clang::Declarator&, clang::Scope*)
workspace/llvm-project/clang/lib/Sema/SemaType.cpp:5687:16
  clang::Sema::ActOnParamDeclarator(clang::Scope*, clang::Declarator&)
workspace/llvm-project/clang/lib/Sema/SemaDecl.cpp:13575:27
  clang::Parser::ParseParameterDeclarationClause(clang::DeclaratorContext,
clang::ParsedAttributes&,
llvm::SmallVectorImpl<clang::DeclaratorChunk::ParamInfo>&,
clang::SourceLocation&)
workspace/llvm-project/clang/lib/Parse/ParseDecl.cpp:6866:29
# clang::Parser::ParseFunctionDeclarator(clang::Declarator&,
clang::ParsedAttributes&, clang::BalancedDelimiterTracker&, bool, bool)
workspace/llvm-project/clang/lib/Parse/ParseDecl.cpp:0:7
# clang::Parser::ParseDirectDeclarator(clang::Declarator&)
workspace/llvm-project/clang/lib/Parse/ParseDecl.cpp:6173:9
# clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&))
workspace/llvm-project/clang/lib/Parse/ParseDecl.cpp:0:7
# clang::Declarator::hasName() const
workspace/llvm-project/clang/include/clang/Sema/DeclSpec.h:2179:27
# clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
workspace/llvm-project/clang/lib/Parse/ParseDecl.cpp:1934:10
#
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
workspace/llvm-project/clang/lib/Parse/Parser.cpp:0:10
#
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
workspace/llvm-project/clang/lib/Parse/Parser.cpp:1150:12
#
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) workspace/llvm-project/clang/lib/Parse/Parser.cpp:0:12
# clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&,
bool) workspace/llvm-project/clang/lib/Parse/Parser.cpp:716:10
# clang::ParseAST(clang::Sema&, bool, bool)
workspace/llvm-project/clang/lib/Parse/ParseAST.cpp:157:5

-- 
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/20210209/94c35224/attachment-0001.html>


More information about the llvm-bugs mailing list