Skip to content

Instantly share code, notes, and snippets.

@rburing
Last active August 29, 2015 13:57
Show Gist options
  • Save rburing/9379754 to your computer and use it in GitHub Desktop.
Save rburing/9379754 to your computer and use it in GitHub Desktop.
// crash clang++ 3.3
template<char... elements>
class Chars
{
friend void f(Chars<elements>) {} // without friend does not crash
};
/*
% clang++ -v -std=c++0x -c crashclang.cc
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix
"/usr/bin/clang++" -cc1 -triple x86_64-unknown-freebsd10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name crashclang.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -coverage-file /home/rburing/rug/cpp/part3/set3/crashclang.o -resource-dir /usr/bin/../lib/clang/3.3 -internal-isystem /usr/include/c++/v1 -std=c++0x -fdeprecated-macro -fdebug-compilation-dir /home/rburing/rug/cpp/part3/set3 -ferror-limit 19 -fmessage-length 98 -mstackrealign -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops -o crashclang.o -x c++ crashclang.cc
clang -cc1 version 3.3 based upon LLVM 3.3 default target x86_64-unknown-freebsd10.0
ignoring nonexistent directory "/usr/include/c++/4.2/backward/backward"
ignoring nonexistent directory "/usr/bin/../lib/clang/3.3/include"
ignoring duplicate directory "/usr/include/c++/4.2"
ignoring duplicate directory "/usr/include/c++/4.2/backward"
ignoring duplicate directory "/usr/include/c++/4.2/backward"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/v1
/usr/include/c++/4.2
/usr/include/c++/4.2/backward
/usr/include/clang/3.3
/usr/include
End of search list.
crashclang.cc:4:17: error: friend declaration contains unexpanded parameter pack 'elements'
friend void f(Chars<elements>) {} // without friend does not crash
^ ~~~~~~~~
Stack dump:
0. Program arguments: /usr/bin/clang++ -cc1 -triple x86_64-unknown-freebsd10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name crashclang.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -coverage-file /home/rburing/rug/cpp/part3/set3/crashclang.o -resource-dir /usr/bin/../lib/clang/3.3 -internal-isystem /usr/include/c++/v1 -std=c++0x -fdeprecated-macro -fdebug-compilation-dir /home/rburing/rug/cpp/part3/set3 -ferror-limit 19 -fmessage-length 98 -mstackrealign -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops -o crashclang.o -x c++ crashclang.cc
1. crashclang.cc:5:1: current parser token '}'
2. crashclang.cc:2:1: parsing struct/union/class body 'Chars'
clang++: error: unable to execute command: Segmentation fault
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix
clang++: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/crashclang-HQbGDx.cpp
clang++: note: diagnostic msg: /tmp/crashclang-HQbGDx.sh
clang++: note: diagnostic msg:
********************
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment