[llvm-bugs] [Bug 42779] New: Fold expression causes clang::TypeInfo clang::ASTContext::getTypeInfoImpl(const clang::Type *) const: Assertion `!T->isDependentType() && "should not see dependent types here"'

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 26 08:18:26 PDT 2019


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

            Bug ID: 42779
           Summary: Fold expression causes clang::TypeInfo
                    clang::ASTContext::getTypeInfoImpl(const clang::Type
                    *) const: Assertion `!T->isDependentType() && "should
                    not see dependent types here"'
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david at doublewise.net
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

The following translation unit:

template<typename... Ts>
struct s {
        template<typename>
        static inline bool any = (... or Ts());

        using type = decltype(any<int>);
};

void f() {
        s<int>::type adsf = 0;
}





Causes the following error with clang trunk:


clang-10: /home/david/llvm/clang/include/clang/AST/TypeNodes.def:90:
clang::TypeInfo clang::ASTContext::getTypeInfoImpl(const clang::Type *) const:
Assertion `!T->isDependentType() && "should not see dependent types here"'
failed.
Stack dump:
0.      Program arguments: /home/david/llvm/build/bin/clang-10 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
preprocessed.cpp -mrelocation-model static -mthread-model posix
-mframe-pointer=all -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -coverage-notes-file /dev/null.gcno -resource-dir
/home/david/llvm/build/lib/clang/10.0.0 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/backward
-internal-isystem /usr/local/include -internal-isystem
/home/david/llvm/build/lib/clang/10.0.0/include -internal-externc-isystem
/include -internal-externc-isystem /usr/include -std=c++17 -fdeprecated-macro
-fdebug-compilation-dir /home/david/tm5/bi2 -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /dev/null -x c++ preprocessed.cpp 
1.      <eof> parser at end of file
2.      preprocessed.cpp:9:6: LLVM IR generation of declaration 'f'
3.      preprocessed.cpp:9:6: Generating code for declaration 'f'
 #0 0x00000000030328dd PrintStackTraceSignalHandler(void*)
(.llvm.5837371964683092683) (/home/david/llvm/build/bin/clang-10+0x30328dd)
 #1 0x0000000003030060 llvm::sys::RunSignalHandlers()
(/home/david/llvm/build/bin/clang-10+0x3030060)
 #2 0x0000000003032d78 SignalHandler(int)
(/home/david/llvm/build/bin/clang-10+0x3032d78)
 #3 0x00007f47eda8d680 __restore_rt (/lib64/libpthread.so.0+0x14680)
 #4 0x00007f47ed49fcc1 raise (/lib64/libc.so.6+0x38cc1)
 #5 0x00007f47ed489535 abort (/lib64/libc.so.6+0x22535)
 #6 0x00007f47ed48940f _nl_load_domain.cold (/lib64/libc.so.6+0x2240f)
 #7 0x00007f47ed497712 (/lib64/libc.so.6+0x30712)
 #8 0x000000000511ef84 clang::ASTContext::getTypeInfoImpl(clang::Type const*)
const (/home/david/llvm/build/bin/clang-10+0x511ef84)
 #9 0x000000000511fb5b clang::ASTContext::getTypeInfo(clang::Type const*) const
(/home/david/llvm/build/bin/clang-10+0x511fb5b)
#10 0x000000000511e1c1 clang::ASTContext::getTypeInfoImpl(clang::Type const*)
const (/home/david/llvm/build/bin/clang-10+0x511e1c1)
#11 0x000000000511fb5b clang::ASTContext::getTypeInfo(clang::Type const*) const
(/home/david/llvm/build/bin/clang-10+0x511fb5b)
#12 0x000000000511e50c clang::ASTContext::getTypeInfoImpl(clang::Type const*)
const (/home/david/llvm/build/bin/clang-10+0x511e50c)
#13 0x000000000511fb5b clang::ASTContext::getTypeInfo(clang::Type const*) const
(/home/david/llvm/build/bin/clang-10+0x511fb5b)
#14 0x000000000511f353 clang::ASTContext::getPreferredTypeAlign(clang::Type
const*) const (/home/david/llvm/build/bin/clang-10+0x511f353)
#15 0x000000000511d496 clang::ASTContext::getDeclAlign(clang::Decl const*,
bool) const (/home/david/llvm/build/bin/clang-10+0x511d496)
#16 0x00000000032c96c9
clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(clang::VarDecl const&)
(/home/david/llvm/build/bin/clang-10+0x32c96c9)
#17 0x00000000032c5407
clang::CodeGen::CodeGenFunction::EmitVarDecl(clang::VarDecl const&)
(/home/david/llvm/build/bin/clang-10+0x32c5407)
#18 0x00000000032c5090 clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl
const&) (/home/david/llvm/build/bin/clang-10+0x32c5090)
#19 0x000000000334814b
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&)
(/home/david/llvm/build/bin/clang-10+0x334814b)
#20 0x000000000333e383
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
(/home/david/llvm/build/bin/clang-10+0x333e383)
#21 0x000000000333ceaa clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/home/david/llvm/build/bin/clang-10+0x333ceaa)
#22 0x0000000003348ea0
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/home/david/llvm/build/bin/clang-10+0x3348ea0)
#23 0x00000000032e0906
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/home/david/llvm/build/bin/clang-10+0x32e0906)
#24 0x0000000003253013
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/home/david/llvm/build/bin/clang-10+0x3253013)
#25 0x0000000003249612
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/home/david/llvm/build/bin/clang-10+0x3249612)
#26 0x0000000003257207
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/home/david/llvm/build/bin/clang-10+0x3257207)
#27 0x0000000003a22e00 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/david/llvm/build/bin/clang-10+0x3a22e00)
#28 0x0000000003a20666
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/david/llvm/build/bin/clang-10+0x3a20666)
#29 0x00000000047a40e3 clang::ParseAST(clang::Sema&, bool, bool)
(/home/david/llvm/build/bin/clang-10+0x47a40e3)
#30 0x0000000003972c4f clang::FrontendAction::Execute()
(/home/david/llvm/build/bin/clang-10+0x3972c4f)
#31 0x00000000038d1ab8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/david/llvm/build/bin/clang-10+0x38d1ab8)
#32 0x0000000003a1bbf7
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/david/llvm/build/bin/clang-10+0x3a1bbf7)
#33 0x0000000001fb340b cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/david/llvm/build/bin/clang-10+0x1fb340b)
#34 0x0000000001fb1168 main (/home/david/llvm/build/bin/clang-10+0x1fb1168)
#35 0x00007f47ed48af1b __libc_start_main (/lib64/libc.so.6+0x23f1b)
#36 0x0000000001fae02a _start (/home/david/llvm/build/bin/clang-10+0x1fae02a)
clang-10: error: unable to execute command: Aborted (core dumped)
clang-10: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 10.0.0 (https://github.com/llvm-project/llvm-project-20170507/
3e8167875c9f2ca923ea313ec820b260249f5a96)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/david/llvm/build/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-10: note: diagnostic msg: 
********************

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

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




See it live: https://godbolt.org/z/6K0hDk

-- 
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/20190726/8dab9eed/attachment-0001.html>


More information about the llvm-bugs mailing list