https://llvm.org/bugs/show_bug.cgi?id=27851
Bug ID: 27851 Summary: Non-type parameter link failure in a template function with a dependent template parameter Product: clang Version: 3.8 Hardware: PC URL: http://coliru.stacked-crooked.com/a/76dbf47d66e9ba0e OS: Linux Status: NEW Severity: normal Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: kirsha...@yahoo.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified The following code: --- #include <iostream> using namespace std; template <class T, T v> struct foo{ static constexpr T val = v; }; template <class T, T v1, T v2> void isSame4(foo<T, v1> f1, foo<T, v2> f2) { cout << "val1: " << f1.val << ", val2: " << f2.val << " are NOT the same" << endl; } template <class T, T v> void isSame4(foo<T, v> f1, foo<T, v> f2) { cout << "val1: " << f1.val << ", val2: " << f2.val << " are the same" << endl; } int global1 = 3; int main() { isSame4(foo<int, 1>(), foo<int, 1>()); // ok isSame4(foo<int*, &global1>(), foo<int*, &global1>()); // error } --- Linker error: undefined reference to `foo<int*, &global1>::val' (Same, compiles well on g++ 6.1.0). Related (?): #15858: https://llvm.org/bugs/show_bug.cgi?id=15858 -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs