From d06a312a4f1f535bfed77771300a2bd0ad319089 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 6 Aug 2014 21:43:58 -0400 Subject: [PATCH] pt.c (check_explicit_specialization): Don't test DECL_DECLARED_INLINE_P for a variable template. * pt.c (check_explicit_specialization): Don't test DECL_DECLARED_INLINE_P for a variable template. Co-Authored-By: Braden Obrzut From-SVN: r213687 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e4f12b12e2ad..285f05855609 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-08-06 Jason Merrill + Braden Obrzut + + * pt.c (check_explicit_specialization): Don't test + DECL_DECLARED_INLINE_P for a variable template. + 2014-08-06 Paolo Carlini PR c++/43906 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 57e72168be7c..998ace2ca583 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2817,9 +2817,11 @@ 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 (TREE_CODE (decl) == FUNCTION_DECL) /* A specialization is not necessarily COMDAT. */ DECL_COMDAT (decl) = DECL_DECLARED_INLINE_P (decl); + else if (TREE_CODE (decl) == VAR_DECL) + DECL_COMDAT (decl) = false; /* Register this specialization so that we can find it again. */ -- 2.47.3