[LLVMbugs] [Bug 16874] New: clang++ crashes on casts to void of pack expansions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 13 10:55:21 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16874

            Bug ID: 16874
           Summary: clang++ crashes on casts to void of pack expansions
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm-bugs at quasiparticle.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Testcase:

struct S {
    static void foo() {}
};

template<typename... Args>
void run() {
    (void) (Args::foo()...);
}

int main() {
    run<S, S>();
}

Resulting error/stacktrace:

foo.cpp:8:10: error: cannot compile this scalar expression yet
        (void) (Args::foo()...);
                ^~~~~~~~~~~~~~
0  libLLVM-3.3.so  0x00007f7d8b889112 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.3.so  0x00007f7d8b888f79
2  libpthread.so.0 0x00007f7d8a9900e0
3  clang           0x00000000007b0b6a
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 1914
4  clang           0x0000000000562b02
5  clang           0x000000000086150e
6  clang           0x00000000008614fb
7  clang           0x0000000000862a3d
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 61
8  clang           0x0000000000826c5f
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 63
9  clang           0x0000000000831b7f
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 47
10 clang           0x0000000000564b66
11 clang           0x0000000000861938
12 clang           0x0000000000862a3d
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 61
13 clang           0x0000000000826c5f
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 63
14 clang           0x0000000000831b7f
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 47
15 clang           0x00000000008b6652
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 98
16 clang           0x00000000008b683f
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 79
17 clang           0x000000000078d972
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&)
+ 82
18 clang           0x0000000000792014
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 484
19 clang           0x00000000007a042a
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 362
20 clang           0x00000000007a0e8b
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 283
21 clang           0x00000000007a1a4d
clang::CodeGen::CodeGenModule::EmitDeferred() + 125
22 clang           0x00000000007a1a89 clang::CodeGen::CodeGenModule::Release()
+ 9
23 clang           0x0000000000781ab0
24 clang           0x00000000008d024b clang::ParseAST(clang::Sema&, bool, bool)
+ 507
25 clang           0x0000000000639339 clang::FrontendAction::Execute() + 169
26 clang           0x000000000061a522
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 290
27 clang           0x0000000000605bc7
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1591
28 clang           0x00000000006010c8 cc1_main(char const**, char const**, char
const*, void*) + 1208
29 clang           0x00000000005ffa6b main + 7899
30 libc.so.6       0x00007f7d8a0dba15 __libc_start_main + 245
31 clang           0x00000000006000d1
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-unknown-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
foo.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.23.2 -resource-dir /usr/bin/../lib/clang/3.3
-internal-isystem
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/c++/4.8.1
-internal-isystem
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/c++/4.8.1/x86_64-unknown-linux-gnu
-internal-isystem
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/c++/4.8.1/backward
-internal-isystem
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/x86_64-unknown-linux-gnu/c++/4.8.1
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.3/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /dev/shm -ferror-limit 19 -fmessage-length 78
-mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o /tmp/foo-NgSiHJ.o -x c++ foo.cpp 
1.    <eof> parser at end of file
2.    Per-file LLVM IR generation
3.    foo.cpp:6:6: Generating code for declaration 'run'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-unknown-linux-gnu
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/foo-ToyHrB.cpp
clang: note: diagnostic msg: /tmp/foo-ToyHrB.sh
clang: note: diagnostic msg: 

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

-- 
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/20130813/ba2159d0/attachment.html>


More information about the llvm-bugs mailing list