<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 --- - Crash on Win8 with invalid std::enable_if usage."
   href="http://llvm.org/bugs/show_bug.cgi?id=21161">21161</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash on Win8 with invalid std::enable_if usage.
          </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>Windows NT
          </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>kyle.sanders@outlook.com
          </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>Crash on Windows 8 with invalid std::enable_if usage. Seems to be associated
with symbol resolution?
Obviously the code below is invalid, don't ask how/why this was discovered.

Source:
#include <type_traits>

struct Bar {
    static std::enable_if<FAKE>::type foo() {
    }
}

Usage:
clang -c Crash.cpp (plus auto-added gunk)

Header & struct & static are required. "FAKE" must be invalid.
'true', 'false', 'sizeof(int) == 4' all seem to work.

Friend on "Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)"
could not reproduce.


Crash.cpp:6:24: error: use of undeclared identifier 'FAKE'
        static std::enable_if<FAKE>::type foo() {
                              ^
Crash.cpp:6:31: error: non-friend class member 'type' cannot have a qualified
      name
        static std::enable_if<FAKE>::type foo() {
                                   ~~^
Crash.cpp:6:31: error: no member named 'type' in the global namespace
        static std::enable_if<FAKE>::type foo() {
                                   ~~^
Stack dump:
0.      Program arguments: C:\Data\dev\tools\bin\clang.exe -cc1 -triple
x86_64-pc-windows-msvc -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name Crash.cpp -mrelocation-model pic
-pic-level 2 -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-target-cpu x86-64 -dwarf-column-info -coverage-file C:\Data\Crash.o
-resource-dir C:\Data\dev\tools\bin\..\lib\clang\3.5.0 -internal-isystem
C:\Data\dev\tools\bin\..\lib\clang\3.5.0\include -internal-isystem C:\Program
Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE -internal-isystem
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE
-internal-isystem C:\Program Files (x86)\Windows Kits\8.1\include\shared
-internal-isystem C:\Program Files (x86)\Windows Kits\8.1\include\um
-internal-isystem C:\Program Files (x86)\Windows Kits\8.1\include\winrt
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir C:\Data -ferror-limit 19
-fmessage-length 80 -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
Crash.o -x c++ Crash.cpp
1.      Crash.cpp:6:36: current parser token 'foo'
2.      Crash.cpp:5:1: parsing struct/union/class body 'Bar'
0x000007F6E724A6E8 (0x00000013E2778780 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x000007F6E71268EA (0x0000000000000000 0x0000000000000000 0x00000013E45BEF90
0x0000001300000000)
0x000007F6E7127BAA (0x0000000000000000 0x0000000000000020 0x0000000000000027
0x0000000000000000)
0x000007F6E712970D (0x0000000000000001 0x0000000000000020 0x0000001300000020
0x000007FCD77E69D8)
0x000007F6E70EF712 (0x00000013E271F428 0x0000000000000000 0x0000000000000000
0x0000A4F600000003)
0x000007F6E70D6D67 (0x00000013E27A3CD0 0x00000013E27A3A30 0x00000013E25ADD40
0x0000000000000000)
0x000007F6E70D7197 (0x00000013E4557A00 0x00000013E25ADC30 0x00000013E27A3A30
0x00000013E25ADD80)
0x000007F6E70D7B39 (0x00000013E2733430 0x00000013E45E0980 0x0000000000000000
0x00000013E25ADE10)
0x000007F6E70D9B0F (0x0000000000000000 0x00000013E2733430 0x00000013E2778780
0x0000000000000000)
0x000007F6E70D3A0E (0x0000000000000000 0x0000000000000000 0x00000013E2702EA0
0x0000000000000009)
0x000007F6E6BD0B9E (0x00000013E2707CB0 0x0000000000000000 0x0000000000000012
0x000007F6E7827609)
0x000007F6E6D79FE8 (0x00000013E2702EA0 0x00000013E2707CB0 0x0000000000000001
0x00000013E270A9D0)
0x000007F6E6BD0AA5 (0x0000000000000000 0x000007F6E7F9E6F0 0x00000013E2707CB0
0x0000000000000000)
0x000007F6E6BAEA58 (0x00006448B4BEB6F7 0x0000000000000000 0x00000013E2707CB0
0x000007F6E6BB7233)
0x000007F6E6C12924 (0x0000000000000001 0x0000000000000000 0x00000013E270A9D0
0x00000013E2707C10)
0x000007F6E618C05E (0x00000013E2706800 0x00000013E25AE960 0x0000000000000000
0x000000000000003C)
0x000007F6E618A605 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x000007F6E779E647 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x000007FCFC771842 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000), BaseThreadInitThunk() + 0x1A bytes(s)
0x000007FCFEDCD609 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
clang.exe: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (tags/RELEASE_350/final)
Target: x86_64-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:</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>