[llvm-bugs] [Bug 47204] New: clang++ crashes in Support/Casting.h

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 17 04:55:57 PDT 2020


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

            Bug ID: 47204
           Summary: clang++ crashes in Support/Casting.h
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tangyixuan at mail.dlut.edu.cn
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Please try to compile the following code:

$: cat s.cpp

template <typename ...T> void a(T ...args1, char ...args2[][sizeof args1]) { }
template <typename T> void b(T) { }
void c() { b(&a<int>); }

$: clang++ -c s.cpp

clang-9:
/home/oscar/compiler/llvm-project/llvm/include/llvm/Support/Casting.h:264:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
clang::TemplateTemplateParmDecl; Y = clang::NamedDecl; typename
llvm::cast_retty<X, Y*>::ret_type = clang::TemplateTemplateParmDecl*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Stack dump:
0.      Program arguments: /usr/local/bin/clang-9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
s.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
-resource-dir /usr/local/lib/clang/10.0.0 -internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/x86_64-pc-linux-gnu
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/lib/clang/10.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /media/oscar/xuaner1/c++bugreprot/TEST-CRASH
-ferror-limit 19 -fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-faddrsig -o s.o -x c++ s.cpp 
1.      s.cpp:3:21: current parser token ')'
2.      s.cpp:3:10: parsing function body 'c'
3.      s.cpp:3:10: in compound statement ('{}')
 #0 0x000055f09a6c305f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/oscar/compiler/llvm-project/llvm/lib/Support/Unix/Signals.inc:544:0

-- 
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/20200817/1a8ff8a0/attachment.html>


More information about the llvm-bugs mailing list