public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14777] New: typedef doesn't fully expose base class type
@ 2004-03-29 21:09 mdorey at bluearc dot com
  2004-03-29 21:19 ` [Bug c++/14777] [3.4/3.5 regression] " bangerth at dealii dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mdorey at bluearc dot com @ 2004-03-29 21:09 UTC (permalink / raw)
  To: gcc-bugs

template <typename T>
struct B
{
protected:
  typedef int M;
};

template <typename T>
struct A : B<T> {
  typedef typename B<T>::M N;
  A (int = N ());
};

A<int> a = A<int> ();

Produces:

Connection.cpp:5: error: `typedef int B<int>::M' is protected
Connection.cpp:14: error: within this context

With recent snapshots (eg gcc 3.4.0 20040324 - can send full version guff if it
wouldn't just be more clutter for you to read).  Sorry, that's as simple as I
managed to make the example - I did try everything I could think of to simplify
it further.

Interestingly, or perhaps not, this does compile when I think it shouldn't. 
It's the same thing except for char instead of int in the typedef for N.

template <typename T>
struct B
{
protected:
  typedef int M;
};

template <typename T>
struct A : B<T> {
  typedef typename B<char>::M N;
  A (int = N ());
};

A<int> a = A<int> ();

-- 
           Summary: typedef doesn't fully expose base class type
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mdorey at bluearc dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/14777] [3.4/3.5 regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
@ 2004-03-29 21:19 ` bangerth at dealii dot org
  2004-06-05 19:51 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2004-03-29 21:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-29 21:19 -------
Confirmed. A regression in 3.4 and mainline. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
      Known to fail|                            |3.4.0 3.5.0
      Known to work|                            |3.3.4
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-29 21:19:26
               date|                            |
            Summary|typedef doesn't fully expose|[3.4/3.5 regression] typedef
                   |base class type             |doesn't fully expose base
                   |                            |class type
   Target Milestone|---                         |3.4.1


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


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

* [Bug c++/14777] [3.4/3.5 regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
  2004-03-29 21:19 ` [Bug c++/14777] [3.4/3.5 regression] " bangerth at dealii dot org
@ 2004-06-05 19:51 ` mmitchel at gcc dot gnu dot org
  2004-06-07 15:52 ` cvs-commit at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-05 19:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-06-05 19:51 -------
Working on a fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/14777] [3.4/3.5 regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
  2004-03-29 21:19 ` [Bug c++/14777] [3.4/3.5 regression] " bangerth at dealii dot org
  2004-06-05 19:51 ` mmitchel at gcc dot gnu dot org
@ 2004-06-07 15:52 ` cvs-commit at gcc dot gnu dot org
  2004-06-07 15:54 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-07 15:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-07 15:52 -------
Subject: Bug 14777

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-06-07 15:52:23

Modified files:
	gcc            : ChangeLog c-common.c 
	gcc/cp         : ChangeLog except.c parser.c pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/eh: throw1.C 
	gcc/testsuite/g++.dg/expr: sizeof3.C 
	gcc/testsuite/g++.dg/template: access14.C enum1.C 

Log message:
	PR c++/15337
	* error.c (c_sizeof_or_alignof_type): Use more detailed error
	message.
	
	PR c++/15766
	* parser.c (cp_parser_iteration_statement): Fix typo in error
	message.
	
	PR c++/14777
	* pt.c (tsubst_default_argument): Do not defer access checks
	while substituting into the default argument.
	
	PR c++/15554
	* pt.c (tsubst_copy): Do not try to substitute for an enumeration
	constant in a non-dependent context.
	
	PR c++/15057
	* except.c (build_throw): Ensure that temp_expr has been
	initialized.
	
	PR c++/15337
	* g++.dg/expr/sizeof3.C: New test.
	
	PR c++/14777
	* g++.dg/template/access14.C: New test.
	
	PR c++/15554
	* g++.dg/template/enum1.C: New test.
	
	PR c++/15057
	* g++.dg/eh/throw1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.470&r2=2.2326.2.471
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.476.4.6&r2=1.476.4.7
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.115&r2=1.3892.2.116
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/except.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.164.4.4&r2=1.164.4.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.31&r2=1.157.2.32
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.28&r2=1.816.2.29
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.197&r2=1.3389.2.198
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/eh/throw1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/sizeof3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/access14.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/enum1.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=14777


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

* [Bug c++/14777] [3.4/3.5 regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
                   ` (2 preceding siblings ...)
  2004-06-07 15:52 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-07 15:54 ` cvs-commit at gcc dot gnu dot org
  2004-06-07 16:24 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-07 15:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-07 15:54 -------
Subject: Bug 14777

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-06-07 15:54:15

Modified files:
	gcc            : ChangeLog c-common.c 
	gcc/cp         : ChangeLog except.c parser.c pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/eh: throw1.C 
	gcc/testsuite/g++.dg/expr: sizeof3.C 
	gcc/testsuite/g++.dg/template: access14.C enum1.C 

Log message:
	PR c++/15337
	* error.c (c_sizeof_or_alignof_type): Use more detailed error
	message.
	
	PR c++/15766
	* parser.c (cp_parser_iteration_statement): Fix typo in error
	message.
	
	PR c++/14777
	* pt.c (tsubst_default_argument): Do not defer access checks
	while substituting into the default argument.
	
	PR c++/15554
	* pt.c (tsubst_copy): Do not try to substitute for an enumeration
	constant in a non-dependent context.
	
	PR c++/15057
	* except.c (build_throw): Ensure that temp_expr has been
	initialized.
	
	PR c++/15337
	* g++.dg/expr/sizeof3.C: New test.
	
	PR c++/14777
	* g++.dg/template/access14.C: New test.
	
	PR c++/15554
	* g++.dg/template/enum1.C: New test.
	
	PR c++/15057
	* g++.dg/eh/throw1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3859&r2=2.3860
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.509&r2=1.510
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4083&r2=1.4084
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/except.c.diff?cvsroot=gcc&r1=1.167&r2=1.168
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.200&r2=1.201
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.859&r2=1.860
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3816&r2=1.3817
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/eh/throw1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/sizeof3.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/access14.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/enum1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2



-- 


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


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

* [Bug c++/14777] [3.4/3.5 regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
                   ` (3 preceding siblings ...)
  2004-06-07 15:54 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-07 16:24 ` mmitchel at gcc dot gnu dot org
  2005-03-09  4:45 ` [Bug c++/14777] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-07 16:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-06-07 16:24 -------
The first example has been fixed in 3.4.1.

The second example is an accepts-invalid and may not be a regression.  In any
case, it's going to be hard to fix -- the language actually required that you
*both* resolve the typename at template-declaration time, and remember the
spelling of the name so that you can do acccess-checks at template-instantiation
time.  That's not something for which we currently have data structures.  So,
I'm removing the target milestone for this PR.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |accepts-invalid
   Target Milestone|3.4.1                       |---


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


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

* [Bug c++/14777] [3.4/4.0/4.1 Regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
                   ` (4 preceding siblings ...)
  2004-06-07 16:24 ` mmitchel at gcc dot gnu dot org
@ 2005-03-09  4:45 ` pinskia at gcc dot gnu dot org
  2005-05-19 17:22 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-09  4:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-09 04:45 -------
(In reply to comment #5)
> The first example has been fixed in 3.4.1.
> 
> The second example is an accepts-invalid and may not be a regression. 
It is a regression from 3.3.3 and 3.2.3.



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
      Known to fail|3.4.0 4.0.0                 |3.4.0 4.0.0 2.95.3 4.1.0
            Summary|typedef doesn't fully expose|[3.4/4.0/4.1 Regression]
                   |base class type             |typedef doesn't fully expose
                   |                            |base class type
   Target Milestone|---                         |3.4.4


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


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

* [Bug c++/14777] [3.4/4.0/4.1 Regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
                   ` (5 preceding siblings ...)
  2005-03-09  4:45 ` [Bug c++/14777] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-05-19 17:22 ` mmitchel at gcc dot gnu dot org
  2005-07-22 21:12 ` pinskia at gcc dot gnu dot org
  2005-09-27 15:58 ` mmitchel at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:22 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


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

* [Bug c++/14777] [3.4/4.0/4.1 Regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
                   ` (6 preceding siblings ...)
  2005-05-19 17:22 ` mmitchel at gcc dot gnu dot org
@ 2005-07-22 21:12 ` pinskia at gcc dot gnu dot org
  2005-09-27 15:58 ` mmitchel at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-22 21:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-22 21:12 -------
Moving to 4.0.2 pre Mark.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.5                       |4.0.2


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


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

* [Bug c++/14777] [3.4/4.0/4.1 Regression] typedef doesn't fully expose base class type
  2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
                   ` (7 preceding siblings ...)
  2005-07-22 21:12 ` pinskia at gcc dot gnu dot org
@ 2005-09-27 15:58 ` mmitchel at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 15:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

end of thread, other threads:[~2005-09-27 15:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
2004-03-29 21:19 ` [Bug c++/14777] [3.4/3.5 regression] " bangerth at dealii dot org
2004-06-05 19:51 ` mmitchel at gcc dot gnu dot org
2004-06-07 15:52 ` cvs-commit at gcc dot gnu dot org
2004-06-07 15:54 ` cvs-commit at gcc dot gnu dot org
2004-06-07 16:24 ` mmitchel at gcc dot gnu dot org
2005-03-09  4:45 ` [Bug c++/14777] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-05-19 17:22 ` mmitchel at gcc dot gnu dot org
2005-07-22 21:12 ` pinskia at gcc dot gnu dot org
2005-09-27 15:58 ` mmitchel 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).