[llvm-bugs] [Bug 27990] New: clang++ with C++14 templated variables

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 3 04:56:32 PDT 2016


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

            Bug ID: 27990
           Summary: clang++ with C++14 templated variables
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: witosx at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16459
  --> https://llvm.org/bugs/attachment.cgi?id=16459&action=edit
preprocessed source code

Clang segfaults when trying to compile simple code with templated variables
(see the attachment)

#0 0x00007f5447dfca98 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/bin/../lib/libLLVM-3.8.so+0x5eea98)
#1 0x00007f5447dfa686 llvm::sys::RunSignalHandlers()
(/usr/bin/../lib/libLLVM-3.8.so+0x5ec686)
#2 0x00007f5447dfa86a (/usr/bin/../lib/libLLVM-3.8.so+0x5ec86a)
#3 0x00007f5446f03310 __restore_rt (/usr/bin/../lib/libc.so.6+0x33310)
#4 0x000000000146c6ab clang::ASTContext::getTypeInfoImpl(clang::Type const*)
const (/usr/bin/clang-3.8+0x146c6ab)
#5 0x000000000146757f clang::ASTContext::getTypeInfo(clang::Type const*) const
(/usr/bin/clang-3.8+0x146757f)
#6 0x000000000146bc12 clang::ASTContext::getPreferredTypeAlign(clang::Type
const*) const (/usr/bin/clang-3.8+0x146bc12)
#7 0x000000000146bf4b clang::ASTContext::getDeclAlign(clang::Decl const*, bool)
const (/usr/bin/clang-3.8+0x146bf4b)
#8 0x000000000082d1e3
clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(clang::VarDecl const&)
(/usr/bin/clang-3.8+0x82d1e3)
#9 0x000000000082e7e7
clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&)
(/usr/bin/clang-3.8+0x82e7e7)
#10 0x0000000000719c27
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&)
(/usr/bin/clang-3.8+0x719c27)
#11 0x0000000000725f4b
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
(/usr/bin/clang-3.8+0x725f4b)
#12 0x00000000007221ba clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*) (/usr/bin/clang-3.8+0x7221ba)
#13 0x000000000072264f
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) (/usr/bin/clang-3.8+0x72264f)
#14 0x000000000073e6bd
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) (/usr/bin/clang-3.8+0x73e6bd)
#15 0x0000000000746cb5
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/bin/clang-3.8+0x746cb5)
#16 0x000000000075d985
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/bin/clang-3.8+0x75d985)
#17 0x000000000076dcdb
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/bin/clang-3.8+0x76dcdb)
#18 0x000000000076e990
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/usr/bin/clang-3.8+0x76e990)
#19 0x000000000076f369 (/usr/bin/clang-3.8+0x76f369)
#20 0x0000000000a47aba (/usr/bin/clang-3.8+0xa47aba)
#21 0x0000000000a4260c (/usr/bin/clang-3.8+0xa4260c)
#22 0x0000000000b8a92e clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/clang-3.8+0xb8a92e)
#23 0x00000000009c2a6e clang::FrontendAction::Execute()
(/usr/bin/clang-3.8+0x9c2a6e)
#24 0x00000000009968e6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/clang-3.8+0x9968e6)
#25 0x0000000000a41bb3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/clang-3.8+0xa41bb3)
#26 0x00000000006a7b18 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang-3.8+0x6a7b18)
#27 0x00000000006a3d38 main (/usr/bin/clang-3.8+0x6a3d38)
#28 0x00007f5446ef0741 __libc_start_main (/usr/bin/../lib/libc.so.6+0x20741)
#29 0x00000000006a5a89 _start (/usr/bin/clang-3.8+0x6a5a89)
Stack dump:
0.    Program arguments: /usr/bin/clang-3.8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name cash.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -coverage-file
/home/rafalw/code/cash.cpp -resource-dir /usr/bin/../lib/clang/3.8.0 -I
/home/rafalw/workspace/rafalw/src/ -internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1/x86_64-pc-linux-gnu
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.8.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Wall -Wextra -std=c++14
-fdeprecated-macro -fdebug-compilation-dir /home/rafalw/code -ferror-limit 19
-fmessage-length 111 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o cash.o -x c++ cash.cpp 
1.    <eof> parser at end of file
2.    cash.cpp:12:6: LLVM IR generation of declaration 'foo'
3.    cash.cpp:12:6: Generating code for declaration 'foo'
clang-3.8: error: unable to execute command: Segmentation fault (core dumped)
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-3.8: 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-3.8: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.8: note: diagnostic msg: /tmp/cash-fc6338.cpp
clang-3.8: note: diagnostic msg: /tmp/cash-fc6338.sh
clang-3.8: 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/20160603/15536401/attachment-0001.html>


More information about the llvm-bugs mailing list