public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>"
@ 2004-03-09  1:17 giovannibajo at libero dot it
  2004-03-09  1:18 ` [Bug c++/14497] " giovannibajo at libero dot it
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-09  1:17 UTC (permalink / raw)
  To: gcc-bugs

----------------------------------
template <int N>  
struct A { 
  template<int M> void B () ; 
}; 

// template <> template <>
void A<0>::B<0>() 
{
} 
----------------------------------

This code snippet should be rejected because it is invalid (the two 
specialization headers 'template <>' are commented), but it does not and it is 
silently accepted.

The problem *appears* to be in pt.c:maybe_check_template_type:

      if (template_header_count <= context_depth)
	/* This is OK; the template headers are for the context.  We
	   are actually too lenient here; like
	   check_explicit_specialization we should consider the number
	   of template types included in the actual declaration.

but I'm not sure.

-- 
           Summary: Accepts invalid specialization of member template
                    missing "template<>"
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giovannibajo at libero dot it
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/14497] Accepts invalid specialization of member template missing "template<>"
  2004-03-09  1:17 [Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>" giovannibajo at libero dot it
@ 2004-03-09  1:18 ` giovannibajo at libero dot it
  2004-03-09  1:25 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-09  1:18 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.3.1 3.3.3 3.4.0 3.5.0


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


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

* [Bug c++/14497] Accepts invalid specialization of member template missing "template<>"
  2004-03-09  1:17 [Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>" giovannibajo at libero dot it
  2004-03-09  1:18 ` [Bug c++/14497] " giovannibajo at libero dot it
@ 2004-03-09  1:25 ` pinskia at gcc dot gnu dot org
  2004-06-18 13:20 ` giovannibajo at libero dot it
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-09  1:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-09 01:25 -------
Confirm, 2.95.3 and 3.0.4 also accepts this code.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|3.3.1 3.3.3 3.4.0 3.5.0     |3.3.1 3.3.3 3.4.0 3.5.0
                   |                            |2.95.3 3.0.4
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-09 01:25:08
               date|                            |


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


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

* [Bug c++/14497] Accepts invalid specialization of member template missing "template<>"
  2004-03-09  1:17 [Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>" giovannibajo at libero dot it
  2004-03-09  1:18 ` [Bug c++/14497] " giovannibajo at libero dot it
  2004-03-09  1:25 ` pinskia at gcc dot gnu dot org
@ 2004-06-18 13:20 ` giovannibajo at libero dot it
  2004-06-18 13:51 ` giovannibajo at libero dot it
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-18 13:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-06-18 13:20 -------
Testing a patch for this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |giovannibajo at libero dot
                   |dot org                     |it
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/14497] Accepts invalid specialization of member template missing "template<>"
  2004-03-09  1:17 [Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>" giovannibajo at libero dot it
                   ` (2 preceding siblings ...)
  2004-06-18 13:20 ` giovannibajo at libero dot it
@ 2004-06-18 13:51 ` giovannibajo at libero dot it
  2004-07-21  0:13 ` cvs-commit at gcc dot gnu dot org
  2004-07-21  0:14 ` giovannibajo at libero dot it
  5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-18 13:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-06-18 13:51 -------
Patch posted, waiting for review:
http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01499.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug c++/14497] Accepts invalid specialization of member template missing "template<>"
  2004-03-09  1:17 [Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>" giovannibajo at libero dot it
                   ` (3 preceding siblings ...)
  2004-06-18 13:51 ` giovannibajo at libero dot it
@ 2004-07-21  0:13 ` cvs-commit at gcc dot gnu dot org
  2004-07-21  0:14 ` giovannibajo at libero dot it
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-21  0:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-07-21 00:13 -------
Subject: Bug 14497

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	giovannibajo@gcc.gnu.org	2004-07-21 00:13:41

Modified files:
	gcc/cp         : ChangeLog pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: spec16.C 
Removed files:
	gcc/testsuite/g++.old-deja/g++.robertl: eb118.C 

Log message:
	PR c++/14497
	* pt.c (check_explicit_specialization): Remove extension to accept
	specializations without template headers. Fall-through to normal
	processing.
	
	PR c++/14497
	* g++.dg/template/spec16.C: New test.
	* g++.old-deja/g++.robertl/eb118.C: Remove.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4236&r2=1.4237
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.893&r2=1.894
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4027&r2=1.4028
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/spec16.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C.diff?cvsroot=gcc&r1=1.7&r2=NONE



-- 


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


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

* [Bug c++/14497] Accepts invalid specialization of member template missing "template<>"
  2004-03-09  1:17 [Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>" giovannibajo at libero dot it
                   ` (4 preceding siblings ...)
  2004-07-21  0:13 ` cvs-commit at gcc dot gnu dot org
@ 2004-07-21  0:14 ` giovannibajo at libero dot it
  5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-21  0:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-21 00:14 -------
Fixed for GCC 3.5.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


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


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

end of thread, other threads:[~2004-07-21  0:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-09  1:17 [Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>" giovannibajo at libero dot it
2004-03-09  1:18 ` [Bug c++/14497] " giovannibajo at libero dot it
2004-03-09  1:25 ` pinskia at gcc dot gnu dot org
2004-06-18 13:20 ` giovannibajo at libero dot it
2004-06-18 13:51 ` giovannibajo at libero dot it
2004-07-21  0:13 ` cvs-commit at gcc dot gnu dot org
2004-07-21  0:14 ` giovannibajo at libero dot it

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).