<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang++ segmentation fault"
   href="http://llvm.org/bugs/show_bug.cgi?id=19918">19918</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang++ segmentation fault
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dark.knight.ita@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12588" name="attach_12588" title="Preprocessed source">attachment 12588</a> <a href="attachment.cgi?id=12588&action=edit" title="Preprocessed source">[details]</a></span>
Preprocessed source

I obtained this segmentation fault while using 3.4.1 on my Gentoo installation:

clang version 3.4.1 (tags/RELEASE_34/dot1-final)
Target: x86_64-pc-linux-gnu
Thread model: posix
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3
 "/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -main-file-name bug.cc -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 -v -resource-dir /usr/bin/../lib/clang/3.4.1 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.4.1/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/marcol/bay/llvm -ferror-limit 19 -fmessage-length
190 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
/tmp/bug-da7995.o -x c++ bug.cc
clang -cc1 version 3.4.1 based upon LLVM 3.4.1 default target
x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/x86_64-pc-linux-gnu
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/backward
 /usr/bin/../lib/clang/3.4.1/include
 /usr/include
End of search list.
0  libLLVM-3.4.1.so 0x00007f52fd1218d2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.4.1.so 0x00007f52fd1216c9
2  libpthread.so.0  0x00007f52fc836bb0
3  libLLVM-3.4.1.so 0x00007f52fd215ee1
llvm::ConstantExpr::getBitCast(llvm::Constant*, llvm::Type*) + 17
4  clang            0x000000000072ef7d
clang::CodeGen::CodeGenModule::EmitConstantValue(clang::APValue const&,
clang::QualType, clang::CodeGen::CodeGenFunction*) + 1693
5  clang            0x000000000072cfea
clang::CodeGen::CodeGenModule::EmitConstantExpr(clang::Expr const*,
clang::QualType, clang::CodeGen::CodeGenFunction*) + 474
6  clang            0x000000000072e4fa
7  clang            0x0000000000730348
clang::CodeGen::CodeGenModule::EmitConstantInit(clang::VarDecl const&,
clang::CodeGen::CodeGenFunction*) + 1032
8  clang            0x00000000007d2187
clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission
const&) + 807
9  clang            0x00000000007d8aa1
clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&) + 33
10 clang            0x000000000073ee67
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) + 87
11 clang            0x0000000000747525
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 245
12 clang            0x00000000007449a3
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 35
13 clang            0x000000000074709f
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 79
14 clang            0x000000000074fe86
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 54
15 clang            0x00000000007546dd
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 493
16 clang            0x0000000000765915
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 357
17 clang            0x0000000000765cfb
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 315
18 clang            0x00000000007663bd
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1517
19 clang            0x0000000000766a8b
20 clang            0x00000000007119a3
21 clang            0x0000000000711156
22 clang            0x0000000000882f01 clang::ParseAST(clang::Sema&, bool,
bool) + 289
23 clang            0x00000000005aea19 clang::FrontendAction::Execute() + 185
24 clang            0x000000000058f00a
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 282
25 clang            0x0000000000578996
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1542
26 clang            0x00000000005718d8 cc1_main(char const**, char const**,
char const*, void*) + 840
27 clang            0x0000000000575f61 main + 673
28 libc.so.6        0x00007f52fc4a0965 __libc_start_main + 245
29 clang            0x0000000000571409
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
bug.cc -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 -v -resource-dir /usr/bin/../lib/clang/3.4.1
-internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.4.1/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/marcol/bay/llvm -ferror-limit 19 -fmessage-length
190 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
/tmp/bug-da7995.o -x c++ bug.cc 
1.    <eof> parser at end of file
2.    bug.cc:9:5: LLVM IR generation of declaration 'main'
3.    bug.cc:9:5: Generating code for declaration 'main'
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.4.1 (tags/RELEASE_34/dot1-final)
Target: x86_64-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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/bug-15a7d2.cpp
clang: note: diagnostic msg: /tmp/bug-15a7d2.sh
clang: note: diagnostic msg:</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>