<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 compiler failed to compile pseudo-destructor-name code in a complex template"
   href="https://llvm.org/bugs/show_bug.cgi?id=23523">23523</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang compiler failed to compile pseudo-destructor-name code in a complex template
          </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++14
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>test1@doramail.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>Based on
<a href="http://stackoverflow.com/questions/30201414/why-does-clang-compiler-fail-to-compile-the-following-variadic-template-code">http://stackoverflow.com/questions/30201414/why-does-clang-compiler-fail-to-compile-the-following-variadic-template-code</a>,
the following code failed to compile with Clang but it works fine in GCC.

Steps to Reproduce:

Create a file with the following code

#include <string>
#include <iostream>
#include <tuple>
#include <utility>


template<typename... T> struct test {

    using args_type = std::tuple<T...>;

    args_type x;

    template<std::size_t... I>
    void callme(std::index_sequence<I...>) {
        int _[] = {(std::get<I>(x).std::tuple_element<I,
args_type>::type::~type(), true)...};
    }
};

int main() {
}

Expected result:
It should compile fine

Actual result:

It looks like Clang failed to use the context to evaluate type::~type()
correctly. Clang failed with the following error:

clang-3.7  -std=gnu++1y  -Wc++14-extensions test.cpp
test.cpp:15:56: error: expected ')'
        int _[] = {(std::get<I>(x).std::tuple_element<I,
args_type>::type::~type(), true)...};
                                                       ^
test.cpp:15:20: note: to match this '('
        int _[] = {(std::get<I>(x).std::tuple_element<I,
args_type>::type::~type(), true)...};
                   ^
1 error generated.

Version:
clang-3.7 -v
Ubuntu clang version 3.7.0-svn236859-1~exp1 (trunk) (based on LLVM 3.7.0)
Target: x86_64-pc-linux-gnu
Thread model: posix</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>