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

            Bug ID: 42718
           Summary: clang=8.0 behaves different from clang=6.0 it should
                    template as stated by standard - "As is the case with
                    typename, the template prefix is allowed even if the
                    name is not dependent"
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

The code example compiles with all compilers except clang=8 

https://godbolt.org/z/VpwYDF




#include <utility>

struct A  {
    template<typename T> void func( T && t ) {}
};


struct B  {
    void func( int  ) {}
};

struct C {
    template<typename T, typename U> void func(T && t, U && u) {
         //"As is the case with typename, the template prefix is allowed even
if the name is not dependent"
        t.template func(std::forward<U>(u));
    }
};

int main () {
    C c ;
    c.func(A(), 1);
    c.func(B(), 1);
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to