[LLVMbugs] [Bug 23523] New: Clang compiler failed to compile pseudo-destructor-name code in a complex template

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 14 06:42:02 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23523

            Bug ID: 23523
           Summary: Clang compiler failed to compile
                    pseudo-destructor-name code in a complex template
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: test1 at doramail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Based on
http://stackoverflow.com/questions/30201414/why-does-clang-compiler-fail-to-compile-the-following-variadic-template-code,
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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150514/bb9ae787/attachment.html>


More information about the llvm-bugs mailing list