Here's a patch for the more conservative option. - Braden Obrzut
2014-08-06 Braden Obrzut <ad...@maniacsvault.net> * pt.c (check_explicit_specialization): Ensure tmpl is a function template before checking if it is inline for COMDAT.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 57e7216..3bc3961 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2817,7 +2817,7 @@ check_explicit_specialization (tree declarator, It's just the name of an instantiation. But, it's not a request for an instantiation, either. */ SET_DECL_IMPLICIT_INSTANTIATION (decl); - else + else if (DECL_FUNCTION_TEMPLATE_P (tmpl)) /* A specialization is not necessarily COMDAT. */ DECL_COMDAT (decl) = DECL_DECLARED_INLINE_P (decl);