diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-11-25 01:59:30 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-11-25 01:59:30 +0000 |
commit | 2ad9569d62e67713613e299867239292afe27733 (patch) | |
tree | 8a5e72a916182a6a9f37b3b666c7dcdd7d8ad0cb /gcc/cp | |
parent | becea832efda8b13114bf910b7e8fba9fe517baf (diff) | |
download | ppe42-gcc-2ad9569d62e67713613e299867239292afe27733.tar.gz ppe42-gcc-2ad9569d62e67713613e299867239292afe27733.zip |
* decl.c (start_decl): An explicit specialization of a static data
member is only a definition if it has an initializer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23847 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/decl.c | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0861bb4c31b..94d8d3a8ff4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-11-24 Jason Merrill <jason@yorick.cygnus.com> + * decl.c (start_decl): An explicit specialization of a static data + member is only a definition if it has an initializer. + * except.c (expand_throw): Use cp_finish_decl for the throw temp. * cvt.c (build_up_reference): Pass DIRECT_BIND down into cp_finish_decl. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b21a7a90156..94173636b28 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6770,7 +6770,17 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes) DECL_IN_AGGR_P (decl) = 0; if ((DECL_LANG_SPECIFIC (decl) && DECL_USE_TEMPLATE (decl)) || CLASSTYPE_USE_TEMPLATE (context)) - SET_DECL_TEMPLATE_SPECIALIZATION (decl); + { + SET_DECL_TEMPLATE_SPECIALIZATION (decl); + /* [temp.expl.spec] An explicit specialization of a static data + member of a template is a definition if the declaration + includes an initializer; otherwise, it is a declaration. + + We check for processing_specialization so this only applies + to the new specialization syntax. */ + if (DECL_INITIAL (decl) == NULL_TREE && processing_specialization) + DECL_EXTERNAL (decl) = 1; + } if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl)) cp_pedwarn ("declaration of `%#D' outside of class is not definition", |