<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 --- - Segfault when assigning value to a reference"
   href="http://llvm.org/bugs/show_bug.cgi?id=15650">15650</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segfault when assigning value to a reference
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.2
          </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>vk@vedantk.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=10271" name="attach_10271" title="clang++ backtrace">attachment 10271</a> <a href="attachment.cgi?id=10271&action=edit" title="clang++ backtrace">[details]</a></span>
clang++ backtrace

clang++ attempted to generate a diagnostic for me on the line;

    /* Right hand side is of type Vector3f. */
    Vector3f& normal = loc.second.normalized();

It segfaulted while doing that. The full trace is attached in the file
"trace.txt". Here are the last few frames;

0  libLLVM-3.2.so  0x00007f34d25f40bf
1  libLLVM-3.2.so  0x00007f34d25f4529
2  libpthread.so.0 0x00007f34d189c1e0
3  libLLVM-3.2.so  0x00007f34d25bbb75 llvm::APInt::countLeadingZerosSlowCase()
const + 37
4  libLLVM-3.2.so  0x00007f34d25bbd5d llvm::APInt::EqualSlowCase(llvm::APInt
const&) const + 253 
5  clang           0x0000000000ec22b9
6  clang           0x0000000000ec3113
7  clang           0x0000000000ec4380
clang::FormatASTNodeDiagnosticArgument(clang::DiagnosticsEngine::ArgumentKind,
long, char const*, unsigned int, char const*, unsigned int,
std::pair<clang::DiagnosticsEngine::ArgumentKind, long> const*, unsigned int,
llvm::SmallVectorImpl<char>&, void*, llvm::ArrayRef<long>) + 240
8  clang           0x00000000010235fa clang::Diagnostic::FormatDiagnostic(char
const*, char const*, llvm::SmallVectorImpl<char>&) const + 2570
9  clang           0x0000000000638787
clang::TextDiagnosticPrinter::HandleDiagnostic(clang::DiagnosticsEngine::Level,
clang::Diagnostic const&) + 87
10 clang           0x0000000001027f20
clang::DiagnosticIDs::EmitDiag(clang::DiagnosticsEngine&,
clang::DiagnosticIDs::Level) const + 48
11 clang           0x0000000001028175
clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&) const + 389 
12 clang           0x0000000001021d5c
clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) + 76
13 clang           0x000000000090133b
clang::Sema::EmitCurrentDiagnostic(unsigned int) + 683 

clang++ was able to successfully compile the program when I removed the
reference from the left hand side;

    Vector3f normal = loc.second.normalized();</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>