public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31923]  New: g++ accepts a storage-class-specifier on a template explicit specialization
@ 2007-05-14 19:47 simon_baldwin at yahoo dot com
  2007-05-29 22:54 ` [Bug c++/31923] " patchapp at dberlin dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: simon_baldwin at yahoo dot com @ 2007-05-14 19:47 UTC (permalink / raw)
  To: gcc-bugs

The following test program compiles without error or warning on g++ (versions
2.95.3, 3.4.5, 4.0.2, 4.1.0, 4.1.1, and 4.3-20070323):

template<class T>
static void F();

template<>
static void F<int>();  // Explicit specialization with storage class specifier

The C++ standard seems to disallow this.  From 7.1.1 - Storage class specifiers
[dcl.stc], para 1:

...  A storage-class-specifier shall not be specified in an explicit
specialization (temp.expl.spec) or an explicit instantiation (temp.explicit)
directive.

I couldn't find an existing report of this, but may well have missed one.


-- 
           Summary: g++ accepts a storage-class-specifier on a template
                    explicit specialization
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: simon_baldwin at yahoo dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31923


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/31923] g++ accepts a storage-class-specifier on a template explicit specialization
  2007-05-14 19:47 [Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization simon_baldwin at yahoo dot com
@ 2007-05-29 22:54 ` patchapp at dberlin dot org
  2007-06-14 21:29 ` simon_baldwin at yahoo dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2007-05-29 22:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from patchapp at dberlin dot org  2007-05-29 22:54 -------
Subject: Bug number PR c++/31923

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg02033.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31923


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/31923] g++ accepts a storage-class-specifier on a template explicit specialization
  2007-05-14 19:47 [Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization simon_baldwin at yahoo dot com
  2007-05-29 22:54 ` [Bug c++/31923] " patchapp at dberlin dot org
@ 2007-06-14 21:29 ` simon_baldwin at yahoo dot com
  2007-06-18 22:09 ` simonb at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: simon_baldwin at yahoo dot com @ 2007-06-14 21:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from simon_baldwin at yahoo dot com  2007-06-14 21:29 -------
Note: there's also a C++ language defect report relating to this issue, with
recommendation from the CWG:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#605


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31923


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/31923] g++ accepts a storage-class-specifier on a template explicit specialization
  2007-05-14 19:47 [Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization simon_baldwin at yahoo dot com
  2007-05-29 22:54 ` [Bug c++/31923] " patchapp at dberlin dot org
  2007-06-14 21:29 ` simon_baldwin at yahoo dot com
@ 2007-06-18 22:09 ` simonb at gcc dot gnu dot org
  2007-06-23 19:52 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: simonb at gcc dot gnu dot org @ 2007-06-18 22:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from simonb at gcc dot gnu dot org  2007-06-18 22:09 -------
Subject: Bug 31923

Author: simonb
Date: Mon Jun 18 22:09:14 2007
New Revision: 125829

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125829
Log:
gcc/cp/ChangeLog
2007-06-15  Simon Baldwin <simonb@google.com>

        PR c++/31923
        * parser.c (cp_parser_single_declaration): Added check for storage
        class other than sc_none in parsed declaration, and a flag to indicate
        if the call is part of an explicit template specialization parse.
        * (cp_parser_explicit_specialization): Specialization check flag added
        to call to cp_parser_single_declaration(), set true.
        * (cp_parser_template_declaration_after_export): Specialization check
        flag added to call to cp_parser_single_declaration(), set false.
        * pt.c (check_explicit_specialization): Added code to copy visiblity
        and linkage from the templated function to the explicit specialization.

gcc/testsuite/ChangeLog
2007-06-15  Simon Baldwin <simonb@google.com>

        PR c++/31923
        * g++.dg/template/error25.C: New.
        * g++.dg/template/spec35.C: New.


Added:
    trunk/gcc/testsuite/g++.dg/template/error25.C
    trunk/gcc/testsuite/g++.dg/template/spec35.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31923


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/31923] g++ accepts a storage-class-specifier on a template explicit specialization
  2007-05-14 19:47 [Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization simon_baldwin at yahoo dot com
                   ` (2 preceding siblings ...)
  2007-06-18 22:09 ` simonb at gcc dot gnu dot org
@ 2007-06-23 19:52 ` mmitchel at gcc dot gnu dot org
  2007-06-25 17:24 ` simon_baldwin at yahoo dot com
  2008-05-22 23:01 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-06-23 19:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2007-06-23 19:52 -------
As this patch has been checked in, can this PR be closed?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31923


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/31923] g++ accepts a storage-class-specifier on a template explicit specialization
  2007-05-14 19:47 [Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization simon_baldwin at yahoo dot com
                   ` (3 preceding siblings ...)
  2007-06-23 19:52 ` mmitchel at gcc dot gnu dot org
@ 2007-06-25 17:24 ` simon_baldwin at yahoo dot com
  2008-05-22 23:01 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: simon_baldwin at yahoo dot com @ 2007-06-25 17:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from simon_baldwin at yahoo dot com  2007-06-25 17:24 -------
Indeed it can -- thanks for the reminder.  Marking as FIXED.


-- 

simon_baldwin at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31923


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/31923] g++ accepts a storage-class-specifier on a template explicit specialization
  2007-05-14 19:47 [Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization simon_baldwin at yahoo dot com
                   ` (4 preceding siblings ...)
  2007-06-25 17:24 ` simon_baldwin at yahoo dot com
@ 2008-05-22 23:01 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-22 23:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31923


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-22 23:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-14 19:47 [Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization simon_baldwin at yahoo dot com
2007-05-29 22:54 ` [Bug c++/31923] " patchapp at dberlin dot org
2007-06-14 21:29 ` simon_baldwin at yahoo dot com
2007-06-18 22:09 ` simonb at gcc dot gnu dot org
2007-06-23 19:52 ` mmitchel at gcc dot gnu dot org
2007-06-25 17:24 ` simon_baldwin at yahoo dot com
2008-05-22 23:01 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).