https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98485

--- Comment #3 from Braden Obrzut <admin at maniacsvault dot net> ---
Created attachment 49864
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49864&action=edit
More well defined variant

Added a variant of the code which has all specializations visible at all uses. 
Only thing hidden is the S1<T>::f1 definition itself which should be valid to
do given explicit instantiations.

Same behavior of the second specialization having different linkage for some
reason.  Although in this case a compiler warning is produced on main.cpp.

main.h:25:28: warning: ‘static void S1<T>::f1() [with T = S3]’ used but never
defined

Interestingly despite presumably being more well defined Clang 11 doesn't like
this version at all.

Reply via email to