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

            Bug ID: 25367
           Summary: Should clang warn about partial specialization after
                    instantiation?
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: yaron.ke...@gmail.com
                CC: llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk
    Classification: Unclassified

In the code below, T2<int,int> will not have mytype member, as T2<int,int> is
first instantiated in line 2 and then T2<T,int> specialized in line 3.

1 template <typename T, typename> struct T2 {};
2 template struct T2<int, int>;
3 template <typename T> struct T2<T, int> { typedef int mytype; };
4 void foo() { T2<int,int>::mytype i; }

If we swap lines 2 and 3, T2<int,int> will have mytype as T2<int,int> will find
and use the specialization T2<T,int>.

Similar to error: explicit specialization after instantiation, should we error
or warn about this, a specialization that would have changed existing
instantiation if it would have come before it?

-- 
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

Reply via email to