[LLVMbugs] [Bug 23840] New: SFINAE failure with variadic non-type template parameter

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jun 13 12:04:35 PDT 2015


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

            Bug ID: 23840
           Summary: SFINAE failure with variadic non-type template
                    parameter
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: avi at cloudius-systems.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The sample code:

====== begin sample =====

template <typename T>
struct x1 {
  using type = int;
};

template <typename T>
struct x2 {
};

template <typename T, typename x1<T>::type...>
void f(T x) {
}

template <typename T, typename x2<T>::type...>
void f(T x) {
}

int main(int ac, char** av) {
  f(1);
}

====== end sample ====

Does not compile, as clang does not reject the second overload of f(T), even
though x2<T>::type does not exist.

g++ compiles this.  This error is particularly bad since it causes
std::experimental::optional<> from libstdc++ 5 not to build.

-- 
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/20150613/74566822/attachment.html>


More information about the llvm-bugs mailing list