[PATCH] [bug21156] Partial specialization after implicit/explicit instantiation of class template.

Anton Bikineev ant.bikineev at gmail.com
Sat Oct 4 06:34:41 PDT 2014


Hi all,

I recently found that Clang doesn't behave similiar as GCC
in case of partial specialization ater implicit or explicit
specialization of class template. GCC gives diagnostic like

"error: partial specialization of 'A<const T*>' after instantiation of
'A<const char*>'"

while Clang just ignores it.

C++ [temp.class.spec]p.1 says, that:
"A partial specialization shall be declared before the first
use of a class template specialization that would make use of
the partial specialization as the result of an implicit or explicit 
instantiation in every translation unit in which such a use occurs;
no diagnostic is required."

I'm not sure, probably Clang has its own politics for this. I also
submitted a bug http://llvm.org/bugs/show_bug.cgi?id=21156 and
wrote a patch, which I attached to bug.

I just was wondering, does it really make sense? I'm kind of newbie
in Clang and my code may be incorrect.

Thanks in advance.




More information about the cfe-commits mailing list