<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 --- - Error during template instantiation in exception specification for defaulted functions"
   href="https://llvm.org/bugs/show_bug.cgi?id=23383">23383</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Error during template instantiation in exception specification for defaulted functions
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.6
          </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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mattia.basaglia@gmail.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>When defining exception specification in explicitly defaulted functions, it
appears that templates aren't expanded correctly and clang gives the error
"exception specification is not available until end of class definition".

If the same template has been already expanded the error doesn't occur.

The error occurs on clang 3.6 but not on 3.5.

Follows an example (note that only the first class causes the error):


struct something { static const bool value = true; };
template<class T> struct something_template { static const bool value = true;
};

struct A_error {
    // This fails to compile
    A_error() noexcept(something_template<int>::value) = default;
};

// All of the following compile fine
struct A1 {
    A1() noexcept(1+1) = default;
};
struct A2 {
    A2() noexcept(something::value) = default;
};
struct A3 {
    void foo() noexcept(something_template<int>::value) {}
};
struct A4 {
    A4() noexcept(something_template<int>::value) {}
};
// Note: A5 is identical to A_error but it compiles fine
struct A5 {
    A5() noexcept(something_template<int>::value) = default;
};</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>