public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18747] New: "template<> int i;" accepted
@ 2004-12-01 2:12 reichelt at gcc dot gnu dot org
2004-12-01 3:01 ` [Bug c++/18747] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-12-01 2:12 UTC (permalink / raw)
To: gcc-bugs
The following invalid line of code is accepted since at least gcc 2.95.x:
===========================
template<> int i;
===========================
--
Summary: "template<> int i;" accepted
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: accepts-invalid, monitored
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18747
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/18747] "template<> int i;" accepted
2004-12-01 2:12 [Bug c++/18747] New: "template<> int i;" accepted reichelt at gcc dot gnu dot org
@ 2004-12-01 3:01 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01 3:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-01 03:01 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-12-01 03:01:55
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18747
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/18747] "template<> int i;" accepted
[not found] <bug-18747-4@http.gcc.gnu.org/bugzilla/>
2012-08-23 13:07 ` paolo.carlini at oracle dot com
2012-08-31 21:36 ` jason at gcc dot gnu.org
@ 2012-09-05 15:13 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-09-05 15:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18747
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
AssignedTo|paolo.carlini at oracle dot |unassigned at gcc dot
|com |gnu.org
Target Milestone|--- |4.8.0
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-09-05 15:13:20 UTC ---
Ah, this is fixed, then.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/18747] "template<> int i;" accepted
[not found] <bug-18747-4@http.gcc.gnu.org/bugzilla/>
2012-08-23 13:07 ` paolo.carlini at oracle dot com
@ 2012-08-31 21:36 ` jason at gcc dot gnu.org
2012-09-05 15:13 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2012-08-31 21:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18747
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-08-31 21:35:38 UTC ---
Author: jason
Date: Fri Aug 31 21:35:33 2012
New Revision: 190842
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190842
Log:
PR c++/18747
* pt.c (check_template_variable): New.
(num_template_headers_for_class): Split out...
* decl.c (grokdeclarator): ...from here.
(start_decl): Remove redundant diagnostic.
* cp-tree.h: Declare them
* parser.c (cp_parser_single_declaration): Call check_template_variable.
.
Added:
trunk/gcc/testsuite/g++.dg/parse/error50.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/18747] "template<> int i;" accepted
[not found] <bug-18747-4@http.gcc.gnu.org/bugzilla/>
@ 2012-08-23 13:07 ` paolo.carlini at oracle dot com
2012-08-31 21:36 ` jason at gcc dot gnu.org
2012-09-05 15:13 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-23 13:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18747
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC|gcc-bugs at gcc dot gnu.org |
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-23 13:06:51 UTC ---
Looking into it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/18747] "template<> int i;" accepted
[not found] <bug-18747-1771@http.gcc.gnu.org/bugzilla/>
2006-06-05 6:55 ` sambitdash at gmail dot com
2006-06-05 14:01 ` sambitdash at gmail dot com
@ 2009-10-30 12:41 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-10-30 12:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from reichelt at gcc dot gnu dot org 2009-10-30 12:41 -------
*** Bug 41875 has been marked as a duplicate of this bug. ***
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cs9in at acm dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18747
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/18747] "template<> int i;" accepted
[not found] <bug-18747-1771@http.gcc.gnu.org/bugzilla/>
2006-06-05 6:55 ` sambitdash at gmail dot com
@ 2006-06-05 14:01 ` sambitdash at gmail dot com
2009-10-30 12:41 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 8+ messages in thread
From: sambitdash at gmail dot com @ 2006-06-05 14:01 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 873 bytes --]
------- Comment #3 from sambitdash at gmail dot com 2006-06-05 13:46 -------
>From the C++ standard draft specification
An explicit specialization of any of the following:
function template
class template
member function of a class template
static data member of a class template
member class of a class template
member class template of a class template
member function template of a class template
can be declared by a declaration introduced by template<>; that is:
explicit specialization:
template < > declaration
Hence this is a bug.
--
sambitdash at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sambitdash at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18747
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/18747] "template<> int i;" accepted
[not found] <bug-18747-1771@http.gcc.gnu.org/bugzilla/>
@ 2006-06-05 6:55 ` sambitdash at gmail dot com
2006-06-05 14:01 ` sambitdash at gmail dot com
2009-10-30 12:41 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 8+ messages in thread
From: sambitdash at gmail dot com @ 2006-06-05 6:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from sambitdash at gmail dot com 2006-06-05 06:29 -------
So is:
struct A
{
};
template<> A i;
which means the specilization syntax does not mandate a need the qualifying
class needs to be a template type. That looks interesting!!!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18747
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-09-05 15:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-01 2:12 [Bug c++/18747] New: "template<> int i;" accepted reichelt at gcc dot gnu dot org
2004-12-01 3:01 ` [Bug c++/18747] " pinskia at gcc dot gnu dot org
[not found] <bug-18747-1771@http.gcc.gnu.org/bugzilla/>
2006-06-05 6:55 ` sambitdash at gmail dot com
2006-06-05 14:01 ` sambitdash at gmail dot com
2009-10-30 12:41 ` reichelt at gcc dot gnu dot org
[not found] <bug-18747-4@http.gcc.gnu.org/bugzilla/>
2012-08-23 13:07 ` paolo.carlini at oracle dot com
2012-08-31 21:36 ` jason at gcc dot gnu.org
2012-09-05 15:13 ` paolo.carlini at oracle dot com
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).