<html>
    <head>
      <base href="https://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-cl error on missing exception specification 'throw()'"
   href="https://llvm.org/bugs/show_bug.cgi?id=25265">25265</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang-cl error on missing exception specification 'throw()'
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>drivehappy@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Clang-cl will produce an error when a definition doesn't match the declaration
containing a 'throw()'. I believe this is correct behavior, however MSVC will
silently ignore this and compile. This was originally seen attempting to pull
in the atltime.h header, but can be reproduced with the following:

class Foo {
    int Bar() const throw();
};

int Foo::Bar() const {
    return 0;
}


1>Source.cpp(7,10): error : 'Bar' is missing exception specification 'throw()'



I expect clang-cl with the -fms-extensions option should allow this to compile
with a warning, as it's very difficult to change the ATL headers.


Note: Flipping the throw specification to the definition seems to produce an
expected warning:

class Foo {
    int Bar() const ;
};

int Foo::Bar() const throw() {
    return 0;
}


1>Source.cpp(7,10): warning : exception specification in declaration does not
match previous declaration [-Wmicrosoft-exception-spec]</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>