http://llvm.org/bugs/show_bug.cgi?id=16879

            Bug ID: 16879
           Summary: MSVC, ICC and G++ can compile template with non-type
                    template parameters that clang can't
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

consider:
template <int I> struct A {
};
template <long long I, int J> A<I%J> f(A<I>, A<J>) {
  A<I> a;
  return a;
}
A<-9223372036854775808LL> (*g)(A<-9223372036854775808LL>, A<-1>) =
&f<-9223372036854775808LL, -1>;

we cannot compile this but ICC and G++ both compile and seemingly mangle this
correctly as:
_Z1fILxn9223372036854775808ELin1EE1AIXrmT_T0_EES0_IXT_EES0_IXT0_EE

instead, we get:
error: address of overloaded function 'f' does not match required type 'A<0>
(A<0>, A<-1>)'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to