public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13813] New: Incomplete member variables in a template.
@ 2004-01-22 14:30 mattyt-bugzilla at tpg dot com dot au
  2004-01-22 14:49 ` [Bug c++/13813] " mattyt-bugzilla at tpg dot com dot au
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: mattyt-bugzilla at tpg dot com dot au @ 2004-01-22 14:30 UTC (permalink / raw)
  To: gcc-bugs

This:

class E; template < class A > class Z { E e; };

or this:

template < class A > class Z { class E; E e; };

apparently should not compile under two stage lookup, but they do at the moment.

-- 
           Summary: Incomplete member variables in a template.
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mattyt-bugzilla at tpg dot com dot au
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/13813] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
@ 2004-01-22 14:49 ` mattyt-bugzilla at tpg dot com dot au
  2004-01-22 15:17 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mattyt-bugzilla at tpg dot com dot au @ 2004-01-22 14:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mattyt-bugzilla at tpg dot com dot au  2004-01-22 14:48 -------
Here's another test case:

template < class TP1 >
class MainClass {
public:
  
  class A;
  
  friend class B;
  
  A a;
  
  template < class TP2 > class B {};
  
  class A {
    
    template < class TP2 > friend class B;
    
  };
  
};

int main(int argc, char *argv[]) {
  MainClass<int> var;
}

This rejects the code, but for totally wrong reasons:

taki4.cc: In instantiation of `MainClass<int>::A':
taki4.cc:9:   instantiated from `MainClass<int>'
taki4.cc:22:   instantiated from here
taki4.cc:13: error: `template<class TP2> struct MainClass<int>::B' redeclared as
different kind of symbol
taki4.cc:13: error: previous declaration of `struct B'

I've had it suggested that the original friend class B is OK because it refers
to a global, so why it gives this complaint is beyond me.  The test case seems
very fragile, it goes back to accepting easily.

Note this also exhibits bug #13390, except in this case there doesn't seem to be
 a valid reason for the error.

-- 


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


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

* [Bug c++/13813] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
  2004-01-22 14:49 ` [Bug c++/13813] " mattyt-bugzilla at tpg dot com dot au
@ 2004-01-22 15:17 ` pinskia at gcc dot gnu dot org
  2004-01-23 13:02 ` [Bug c++/13813] [DR206] " giovannibajo at libero dot it
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-22 15:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-22 15:17 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic, rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-22 15:17:11
               date|                            |


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
  2004-01-22 14:49 ` [Bug c++/13813] " mattyt-bugzilla at tpg dot com dot au
  2004-01-22 15:17 ` pinskia at gcc dot gnu dot org
@ 2004-01-23 13:02 ` giovannibajo at libero dot it
  2004-01-23 14:21 ` giovannibajo at libero dot it
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-23 13:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-01-23 13:02 -------
The first testcase is exactly to DR206. It says "no diagnostic required" so we 
probably are already conforming, but nonetheless it's easy to add a diagnostic 
here (I have a patch in progress).

The second testcases is more subtle, because Z<A>::E is a dependent type, as 
explained in DR108 (then reworked by DR224). EDG does not agree with us, but I 
think it's correct to perform the check at instantiation time.

The third testcase (in comment #1) is unrelated, and will be moved to a 
different report.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |giovannibajo at libero dot
                   |dot org                     |it
             Status|NEW                         |ASSIGNED
            Summary|Incomplete member variables |[DR206] Incomplete member
                   |in a template.              |variables in a template.


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (2 preceding siblings ...)
  2004-01-23 13:02 ` [Bug c++/13813] [DR206] " giovannibajo at libero dot it
@ 2004-01-23 14:21 ` giovannibajo at libero dot it
  2004-01-30 16:35 ` cvs-commit at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-23 14:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-01-23 14:21 -------
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2004-01/msg02443.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |accepts-invalid, patch


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (3 preceding siblings ...)
  2004-01-23 14:21 ` giovannibajo at libero dot it
@ 2004-01-30 16:35 ` cvs-commit at gcc dot gnu dot org
  2004-01-30 16:40 ` cvs-commit at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-30 16:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-30 16:35 -------
Subject: Bug 13813

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	giovannibajo@gcc.gnu.org	2004-01-30 16:35:06

Modified files:
	gcc/cp         : ChangeLog decl.c 

Log message:
	DR206
	PR c++/13813
	* decl.c (grokdeclarator): Check immediatly type completeness for
	non-dependent types.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3919&r2=1.3920
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1176&r2=1.1177



-- 


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (4 preceding siblings ...)
  2004-01-30 16:35 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-30 16:40 ` cvs-commit at gcc dot gnu dot org
  2004-01-30 16:42 ` giovannibajo at libero dot it
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-30 16:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-30 16:40 -------
Subject: Bug 13813

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	giovannibajo@gcc.gnu.org	2004-01-30 16:40:43

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: member4.C 

Log message:
	DR206
	PR c++/13813
	* g++.dg/template/member4.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3444&r2=1.3445
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/member4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (5 preceding siblings ...)
  2004-01-30 16:40 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-30 16:42 ` giovannibajo at libero dot it
  2004-02-02 18:45 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-30 16:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-01-30 16:42 -------
Fixed in GCC 3.5.0, thanks for your report!
FYI, I've just asked permission to backport the fix to the 3.4 branch.

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


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (6 preceding siblings ...)
  2004-01-30 16:42 ` giovannibajo at libero dot it
@ 2004-02-02 18:45 ` cvs-commit at gcc dot gnu dot org
  2004-02-02 18:47 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-02 18:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-02 18:45 -------
Subject: Bug 13813

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	giovannibajo@gcc.gnu.org	2004-02-02 18:45:20

Modified files:
	gcc/cp         : ChangeLog decl.c 

Log message:
	DR206
	PR c++/13813
	* decl.c (grokdeclarator): Check immediatly type completeness for
	non-dependent types.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.27&r2=1.3892.2.28
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1174.2.3&r2=1.1174.2.4



-- 


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (7 preceding siblings ...)
  2004-02-02 18:45 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-02 18:47 ` cvs-commit at gcc dot gnu dot org
  2004-02-02 18:48 ` giovannibajo at libero dot it
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-02 18:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-02 18:47 -------
Subject: Bug 13813

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	giovannibajo@gcc.gnu.org	2004-02-02 18:47:21

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: member4.C 

Log message:
	DR206
	PR c++/13813
	* g++.dg/template/member4.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.40&r2=1.3389.2.41
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/member4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (8 preceding siblings ...)
  2004-02-02 18:47 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-02 18:48 ` giovannibajo at libero dot it
  2004-02-02 19:14 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-02 18:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-02 18:48 -------
Backported the patch, this bug is now also fixed in 3.4.0.

-- 


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (9 preceding siblings ...)
  2004-02-02 18:48 ` giovannibajo at libero dot it
@ 2004-02-02 19:14 ` pinskia at gcc dot gnu dot org
  2004-02-03  9:27 ` mmitchel at gcc dot gnu dot org
  2004-02-03 10:15 ` giovannibajo at libero dot it
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-02 19:14 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.5.0                       |3.4.0


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (10 preceding siblings ...)
  2004-02-02 19:14 ` pinskia at gcc dot gnu dot org
@ 2004-02-03  9:27 ` mmitchel at gcc dot gnu dot org
  2004-02-03 10:15 ` giovannibajo at libero dot it
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-03  9:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-02-03 09:27 -------
Does the backport fix PR 10711?

-- 


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


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

* [Bug c++/13813] [DR206] Incomplete member variables in a template.
  2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
                   ` (11 preceding siblings ...)
  2004-02-03  9:27 ` mmitchel at gcc dot gnu dot org
@ 2004-02-03 10:15 ` giovannibajo at libero dot it
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-03 10:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-03 10:15 -------
Yes, it does, Mark.

-- 


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


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

end of thread, other threads:[~2004-02-03 10:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-22 14:30 [Bug c++/13813] New: Incomplete member variables in a template mattyt-bugzilla at tpg dot com dot au
2004-01-22 14:49 ` [Bug c++/13813] " mattyt-bugzilla at tpg dot com dot au
2004-01-22 15:17 ` pinskia at gcc dot gnu dot org
2004-01-23 13:02 ` [Bug c++/13813] [DR206] " giovannibajo at libero dot it
2004-01-23 14:21 ` giovannibajo at libero dot it
2004-01-30 16:35 ` cvs-commit at gcc dot gnu dot org
2004-01-30 16:40 ` cvs-commit at gcc dot gnu dot org
2004-01-30 16:42 ` giovannibajo at libero dot it
2004-02-02 18:45 ` cvs-commit at gcc dot gnu dot org
2004-02-02 18:47 ` cvs-commit at gcc dot gnu dot org
2004-02-02 18:48 ` giovannibajo at libero dot it
2004-02-02 19:14 ` pinskia at gcc dot gnu dot org
2004-02-03  9:27 ` mmitchel at gcc dot gnu dot org
2004-02-03 10:15 ` 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).