<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 --- - Assertion error "isa<X>(Val) && "cast<Ty>() argument of incompatible type!" when compling for target i686-pc-windows-msvc with -g"
   href="http://llvm.org/bugs/show_bug.cgi?id=21005">21005</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion error "isa<X>(Val) && "cast<Ty>() argument of incompatible type!" when compling for target i686-pc-windows-msvc with -g
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>felixhaedicke@web.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>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=13053" name="attach_13053" title="Preprocessed sample code (gzip compressed)">attachment 13053</a> <a href="attachment.cgi?id=13053&action=edit" title="Preprocessed sample code (gzip compressed)">[details]</a></span>
Preprocessed sample code (gzip compressed)

I am compiling C++ code with the clang target "i686-pc-windows-msvc" and the
SDK from VS 2013. When compiling with the arguments "-g" and "-D_DLL", I get an
assertion error for most of my code files. Without -g or without -g, the code
is compiled successfully.

It is reproducible with the attached preprocessed code and the following
commmand line:

clang++ -target i686-pc-windows-msvc Deserialiser.i -c -g -o Deserialiser.o

The assertion message below is generated by Clang 3.5.0 from the official Win32
installer. I have also built a Cygwin version of Clang 3.5.0 (the attached
preprocessed source is generated with the Cygwin build), and I am getting
another message.


Error message from Clang 3.5.0 from the official Win32 installer:

Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!",
file D:\src\llvm_release_build_3.5.0\llvm\include\llvm/Support/Casting.h, line
237
clang++.exe: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (217039)
Target: i686-pc-windows-msvc
Thread model: posix
clang++.exe: 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++.exe: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.


Error message from Clang 3.5.0 built for Cygwin:

Stack dump:
0.      Program arguments: /opt/llvm/3.5/bin/clang-3.5 -cc1 -triple
i686-pc-windows-msvc -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-main-file-name Deserialiser.i -mrelocation-model static -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -g
-dwarf-column-info -coverage-file
/cygdrive/c/Users/felix/Documents/Sources/xcsoar/Deserialiser.o -resource-dir
/opt/llvm/3.5/bin/../lib/clang/3.5.0 -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /cygdrive/c/Users/felix/Documents/Sources/xcsoar
-ferror-limit 19 -fmessage-length 179 -mstackrealign -fms-extensions
-fms-compatibility -fms-compatibility-version=17.00 -fdelayed-template-parsing
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o Deserialiser.o -x c++-cpp-output Deserialiser.i
1.      src/Task/Deserialiser.cpp:113:1: current parser token
'ObservationZonePoint'
2.      src/Task/Deserialiser.cpp:40:15: LLVM IR generation of declaration
'Deserialiser::DeserialiseTaskpoint'
3.      src/Task/Deserialiser.cpp:40:15: Generating code for declaration
'Deserialiser::DeserialiseTaskpoint'</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>