<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 - Clang crash on invalid c++11 code (UNREACHABLE executed at clang/lib/AST/StmtProfile.cpp:1196!)"
   href="https://bugs.llvm.org/show_bug.cgi?id=33281">33281</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang crash on invalid c++11 code (UNREACHABLE executed at clang/lib/AST/StmtProfile.cpp:1196!)
          </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>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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>andrea.dibiagio@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This may be a duplicate of <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - crash on invalid c++ code with "-std=c++14" on x86_64-linux-gnu (UNREACHABLE executed at /path/to/StmtProfile.cpp:1017!)"
   href="show_bug.cgi?id=28793">bug 28793</a>.
However, this bug can also be reproduced with -std=c++11.

I am using:
clang version 5.0.0 (trunk 304555)
Target: x86_64-unknown-linux-gnu

--

Here is the reproducible:

// ============================================================================
template <typename _Ty> struct add_rvalue_reference {
  typedef _Ty &&type;
};

template <typename _Ty> typename add_rvalue_reference<_Ty>::type declval();

template <typename _Fty> struct _Result_of {
  static auto _Fn() -> decltype(declval<_Fty>()());
};

template <typename T> struct Future {};

template <typename Function>
Future<typename _Result_of<Function>::type> Firstly(Function) {
}

void Join() {
  Firstly([] { return Future<void>::foobar; });
}
// ============================================================================

--

<span class="quote">>clang test.cpp -std=gnu++11 -c</span >

test.cpp:18:37: error: no member named 'foobar' in 'Future<void>'
  Firstly([] { return Future<void>::foobar; });
                      ~~~~~~~~~~~~~~^
Invalid operator call kind
UNREACHABLE executed at
/home/andrea/cllvm/llvm/tools/clang/lib/AST/StmtProfile.cpp:1196!</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>