[llvm-bugs] [Bug 46486] New: Clang crash in build/tools/clang/include/clang/AST/TypeNodes.inc:58: clang::TypeInfo clang::ASTContext::getTypeInfoImpl(const clang::Type *) const: Assertion `!T->isDependentType() && "should not see dependent types here"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 27 20:13:01 PDT 2020


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

            Bug ID: 46486
           Summary: Clang crash in
                    build/tools/clang/include/clang/AST/TypeNodes.inc:58:
                    clang::TypeInfo
                    clang::ASTContext::getTypeInfoImpl(const clang::Type
                    *) const: Assertion `!T->isDependentType() && "should
                    not see dependent types here"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

This code, bug.cc, reduced by C-Reduce, makes Clang crashed.

$cat bug.cc
long var1 enum : 
decltype((var2 = throw))::a {

$clang++ bug.cc
bug.cc:1:10: error: expected ';' after top level declarator
long var1 enum : 
         ^
         ;
bug.cc:2:11: error: use of undeclared identifier 'var2'; did you mean 'var1'?
decltype((var2 = throw))::a {
          ^~~~
          var1
bug.cc:1:6: note: 'var1' declared here
long var1 enum : 
     ^
bug.cc:2:18: error: assigning to 'long' from incompatible type 'void'
decltype((var2 = throw))::a {
                 ^~~~~
bug.cc:2:1: error: missing 'typename' prior to dependent type name
'decltype((<recovery-expr>(var1, throw)))::a'
decltype((var2 = throw))::a {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
typename 
bug.cc:2:30: error: expected identifier
decltype((var2 = throw))::a {
                             ^
bug.cc:2:30: error: expected '}'
bug.cc:2:29: note: to match this '{'
decltype((var2 = throw))::a {
                            ^
clang-11:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master-assert/build/tools/clang/include/clang/AST/TypeNodes.inc:58:
clang::TypeInfo clang::ASTContext::getTypeInfoImpl(const clang::Type *) const:
Assertion `!T->isDependentType() && "should not see dependent types here"'
failed.
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:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name bug.cc -mrelocation-model static -mframe-pointer=all
-fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining
-debugger-tuning=gdb -resource-dir
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/lib/clang/11.0.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/lib/clang/11.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/haoxin/compilers/new-scg/new-scg-build/map_test/clang-test/creduce
-ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions
-fcolor-diagnostics -faddrsig -o /tmp/bug-a702cf.o -x c++ bug.cc 
1.      <eof> parser at end of file
 #0 0x00000000026e32c4 PrintStackTraceSignalHandler(void*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x26e32c4)
 #1 0x00000000026e0eae llvm::sys::RunSignalHandlers()
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x26e0eae)
 #2 0x00000000026e35e5 SignalHandler(int)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x26e35e5)
 #3 0x00007f345a481390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #4 0x00007f3458feb428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #5 0x00007f3458fed02a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #6 0x00007f3458fe3bd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
 #7 0x00007f3458fe3c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
 #8 0x00000000047f55c1 clang::ASTContext::getTypeInfoImpl(clang::Type const*)
const
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x47f55c1)
 #9 0x00000000047f6637 clang::ASTContext::getTypeInfo(clang::Type const*) const
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x47f6637)
#10 0x000000000480ab9b clang::ASTContext::getIntWidth(clang::QualType) const
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x480ab9b)
#11 0x00000000040404a0 clang::Sema::ActOnEnumBody(clang::SourceLocation,
clang::SourceRange, clang::Decl*, llvm::ArrayRef<clang::Decl*>, clang::Scope*,
clang::ParsedAttributesView const&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x40404a0)
#12 0x0000000003df95bd clang::Parser::ParseEnumBody(clang::SourceLocation,
clang::Decl*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3df95bd)
#13 0x0000000003df5c5f clang::Parser::ParseEnumSpecifier(clang::SourceLocation,
clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&,
clang::AccessSpecifier, clang::Parser::DeclSpecContext)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3df5c5f)
#14 0x0000000003ded00d
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3ded00d)
#15 0x0000000003dd4c9a
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dd4c9a)
#16 0x0000000003dd49c5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dd49c5)
#17 0x0000000003dd37f3
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dd37f3)
#18 0x0000000003dd183d
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dd183d)
#19 0x0000000003dccb6d clang::ParseAST(clang::Sema&, bool, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dccb6d)
#20 0x0000000002ea0873 clang::FrontendAction::Execute()
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x2ea0873)
#21 0x0000000002e3b0c3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x2e3b0c3)
#22 0x0000000002f4a672
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x2f4a672)
#23 0x0000000000956798 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x956798)
#24 0x0000000000954cac ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x954cac)
#25 0x0000000000954958 main
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x954958)
#26 0x00007f3458fd6830 __libc_start_main
/build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:325:0
#27 0x00000000009519a9 _start
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x9519a9)
clang-11: error: unable to execute command: Aborted (core dumped)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin
clang-11: note: diagnostic msg: 
********************

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

********************


$clang++ --version
clang version 11.0.0 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin

Reproduced in Godbolt : https://godbolt.org/z/dFeBFF

-- 
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/20200628/855ee6e9/attachment-0001.html>


More information about the llvm-bugs mailing list