[LLVMbugs] [Bug 16879] New: MSVC, ICC and G++ can compile template with non-type template parameters that clang can't

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 13 16:26:49 PDT 2013


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: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130813/bf4817c3/attachment.html>


More information about the llvm-bugs mailing list