This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for constexpr variable templates


Here's a patch for the more conservative option.

- Braden Obrzut

2014-08-06  Braden Obrzut  <admin@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);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]