public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
@ 2003-03-29  8:34 Bradley Baetz
  0 siblings, 0 replies; 7+ messages in thread
From: Bradley Baetz @ 2003-03-29  8:34 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10261; it has been noted by GNATS.

From: Bradley Baetz <bbaetz@acm.org>
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
Date: Sat, 29 Mar 2003 15:04:22 +1100

 Actually, ignore what I said about MIPSPro - I misread the testcase in
 the mozilla bug (CharT, not char....).
 
 So I'm not sure if this is a bug or not.
 
 Bradley


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

* Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
@ 2003-04-07 14:42 bangerth
  0 siblings, 0 replies; 7+ messages in thread
From: bangerth @ 2003-04-07 14:42 UTC (permalink / raw)
  To: bbaetz, gcc-bugs, gcc-prs, nobody

Synopsis: g++ does not error for bogus |typename| inside a templated class

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Apr  7 14:42:36 2003
State-Changed-Why:
    On submitter's request

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10261


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

* Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
@ 2003-04-07 11:26 Bradley Baetz
  0 siblings, 0 replies; 7+ messages in thread
From: Bradley Baetz @ 2003-04-07 11:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10261; it has been noted by GNATS.

From: Bradley Baetz <bbaetz@acm.org>
To: Giovanni Bajo <giovannibajo@libero.it>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
   gcc-prs@gcc.gnu.org
Subject: Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
Date: Mon, 7 Apr 2003 21:25:49 +1000

 On Mon, Apr 07, 2003 at 01:08:36PM +0200, Giovanni Bajo wrote:
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 > r=10261
 
 > >Yeah, I think I misread the DR,
 > 
 > Yup, that DR has nothing to do with this.
 > 
 
 Right, and I agreed with you :) Please close this bug report.
 
 > Giovanni Bajo
 
 Bradley


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

* Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
@ 2003-04-07 11:16 Giovanni Bajo
  0 siblings, 0 replies; 7+ messages in thread
From: Giovanni Bajo @ 2003-04-07 11:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

The following reply was made to PR c++/10261; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<bbaetz@acm.org>
Cc:  
Subject: Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
Date: Mon, 7 Apr 2003 13:08:36 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=10261
 
 >> Not a bug. §14.6p5:  "The keyword typename shall only be used in template
 > > declarations and definitions [...]  The keyword typename shall only be
 > > applied to qualified names, but those names need not be dependent."
 
 > right, I wasn't complaining about the first two bits, which should be
 > erroring, but rather pointing out the second two lines.
 
 Please read again: "The keyword typename shall only be applied to qualified
 names, but those names *NEED NOT* be dependent."
 In your example, in the second two lines, foo<int>::value_type is a
 non-dependent qualified name. Use of typename is allowed but not required.
 
 >Yeah, I think I misread the DR,
 
 Yup, that DR has nothing to do with this.
 
 Giovanni Bajo
 


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

* Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
@ 2003-04-07 10:56 Bradley Baetz
  0 siblings, 0 replies; 7+ messages in thread
From: Bradley Baetz @ 2003-04-07 10:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

The following reply was made to PR c++/10261; it has been noted by GNATS.

From: Bradley Baetz <bbaetz@acm.org>
To: Giovanni Bajo <giovannibajo@libero.it>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
   gcc-prs@gcc.gnu.org
Subject: Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
Date: Mon, 7 Apr 2003 20:50:27 +1000

 On Mon, Apr 07, 2003 at 12:27:45PM +0200, Giovanni Bajo wrote:
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 > r=10261
 > 
 > Not a bug. §14.6p5:  "The keyword typename shall only be used in template
 > declarations and definitions [...]  The keyword typename shall only be
 > applied to qualified names, but those names need not be dependent."
 
 right, I wasn't complaining about the first two bits, which should be
 erroring, but rather pointing out the second two lines.
 
 > 
 > In other words, you cannot use 'typename' outside templates. You cannot use
 > 'typename' with unqualified names. You can use 'typename' for non-dependent
 > qualified names (but it's not necessary).
 
 Yeah, I think I misread the DR, (and got confused because I grabbed
 an incorrect testcase from the other compiler in the bugzilla report)
 
 I missed the fact that the DR was talking about specialisations only. 
 
 Bradley


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

* Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
@ 2003-04-07 10:36 Giovanni Bajo
  0 siblings, 0 replies; 7+ messages in thread
From: Giovanni Bajo @ 2003-04-07 10:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

The following reply was made to PR c++/10261; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<bbaetz@acm.org>
Cc:  
Subject: Re: c++/10261: g++ does not error for bogus |typename| inside a templated class
Date: Mon, 7 Apr 2003 12:27:45 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=10261
 
 Not a bug. §14.6p5:  "The keyword typename shall only be used in template
 declarations and definitions [...]  The keyword typename shall only be
 applied to qualified names, but those names need not be dependent."
 
 In other words, you cannot use 'typename' outside templates. You cannot use
 'typename' with unqualified names. You can use 'typename' for non-dependent
 qualified names (but it's not necessary). You must use 'typename' with
 dependent qualified names.
 
 Giovanni Bajo
 


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

* c++/10261: g++ does not error for bogus |typename| inside a templated class
@ 2003-03-29  2:36 bbaetz
  0 siblings, 0 replies; 7+ messages in thread
From: bbaetz @ 2003-03-29  2:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10261
>Category:       c++
>Synopsis:       g++ does not error for bogus |typename| inside a templated class
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 29 01:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Bradley Baetz
>Release:        3.4 20030328 (experimental)
>Organization:
>Environment:
System: Linux mango.home 2.4.18-27.8.0custom #1 Thu Mar 20 20:14:56 EST 2003 i686 i686 i386 GNU/Linux
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-languages=c,c++ --prefix=/home/bbaetz/swtest --program-suffix=-cvs --enable-__cxa_atexit
>Description:
g++ (3.2 and 3.4-cvs) accepts the use of the |typename| keyword even when 
the template is explicitly instatiated and does not have dependant 
parameters, if the use of this occurs from  within a template (see example 
below)

I'm not sure that this is a bug. I only have access to the draft c++ 
standard, but foo<int>::value_type doesn't depend on T, and the |baz| code 
is accepted without the typename also, even in 3.4.

MIPSPro 7.4 appears to disallow both cases, too - see
http://bugzilla.mozilla.org/show_bug.cgi?id=199625 (It also disallows
|typename| as a function param in a templated class, which I think is
incorrect although I'm not sure, so maybe its results should be taken with
a grain of salt...)

However, this appears to be handled by core issue 183
(http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_defects.html#183) though,
which does make the use of |typename| illegal.

>How-To-Repeat:
template<typename T>
struct foo {
  typedef T value_type;
};

struct bar {
  typedef typename foo<int>::value_type t; //errors
  void xxx(typename foo<int>::value_type); //errors
};

template<typename T>
struct baz {
  typedef typename foo<int>::value_type t; //ok, but should be error
  void yyy(typename foo<int>::value_type); //ok, but should be error
};

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:
 


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

end of thread, other threads:[~2003-04-07 14:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-29  8:34 c++/10261: g++ does not error for bogus |typename| inside a templated class Bradley Baetz
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07 14:42 bangerth
2003-04-07 11:26 Bradley Baetz
2003-04-07 11:16 Giovanni Bajo
2003-04-07 10:56 Bradley Baetz
2003-04-07 10:36 Giovanni Bajo
2003-03-29  2:36 bbaetz

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