<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Invalid templates aren't marked as invalid on Windows"
   href="https://bugs.llvm.org/show_bug.cgi?id=49618">49618</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Invalid templates aren't marked as invalid on Windows
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>z.zoelec2@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I think this Godbolt demonstrates the problem pretty clearly:
<a href="https://godbolt.org/z/Mv5osj">https://godbolt.org/z/Mv5osj</a>

Basically, if there's an invalid decl (such as the var decl shown in the
Godbolt), neither the decl nor its parent will be marked invalid on Windows.
But, on all other platforms, they will (properly?) be marked as invalid. I ran
into this problem while testing Swift's C++ interop; it was causing crashes
because we had no way to differentiate valid and invalid decls on Windows, so
invalid decls were slipping through. 

I thought the MS compatibility features might have been the cause of this
issue, but the problem persists when I pass -fno-delayed-template-parsing and
-fno-ms-compatibility. 

I'd like to understand why this is happening and if it's the intended behavior.
I'd also like to find a good short-term solution so that I can stop Swift's C++
interop from crashing. (Whether that's a flag to disable it or another API that
I can use to find out if the decl is actually invalid. Right now, I'm using
"isInvalidDecl.")</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>