aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-11-03 19:45:10 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-11-03 19:45:10 +0000
commita39041fae9f62c038e457f754c7578fb7e772dbb (patch)
treedea56d9d67c7b62563b127fbb29c1025411a7d4c /gcc/cp
parent98d59fe652402d1b42d3da0f39ab897d13d7a042 (diff)
downloadgcc-a39041fae9f62c038e457f754c7578fb7e772dbb.zip
gcc-a39041fae9f62c038e457f754c7578fb7e772dbb.tar.gz
gcc-a39041fae9f62c038e457f754c7578fb7e772dbb.tar.bz2
re PR c++/21627 (invalid inline warning with ctor and dtor)
PR c++/21627 * pt.c (register_specialization): Update inline flags on clones.y PR c++/21627 * g++.dg/warn/inline2.C: New test. From-SVN: r106442
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c18
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e1edc45..625413b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21627
+ * pt.c (register_specialization): Update inline flags on clones.y
+
2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/24582
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ecfc6d1..1efd808 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1179,6 +1179,7 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend)
}
else
{
+ tree clone;
/* This situation should occur only if the first
specialization is an implicit instantiation, the
second is an explicit specialization, and the
@@ -1204,6 +1205,23 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend)
there were no definition, and vice versa. */
DECL_INITIAL (fn) = NULL_TREE;
duplicate_decls (spec, fn, is_friend);
+ /* The call to duplicate_decls will have applied
+ [temp.expl.spec]:
+
+ An explicit specialization of a function template
+ is inline only if it is explicitly declared to be,
+ and independently of whether its function tempalte
+ is.
+
+ to the primary function; now copy the inline bits to
+ the various clones. */
+ FOR_EACH_CLONE (clone, fn)
+ {
+ DECL_DECLARED_INLINE_P (clone)
+ = DECL_DECLARED_INLINE_P (fn);
+ DECL_INLINE (clone)
+ = DECL_INLINE (fn);
+ }
check_specialization_namespace (fn);
return fn;