public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3033: 'using typename' construct doesn't work
@ 2001-06-01 13:46 sethml
0 siblings, 0 replies; 5+ messages in thread
From: sethml @ 2001-06-01 13:46 UTC (permalink / raw)
To: gcc-gnats, debian-gcc
>Number: 3033
>Category: c++
>Synopsis: The 'using typename' construct won't compile
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Jun 01 13:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Seth M LaForge
>Release: 3.0 20010526 (Debian prerelease) (Debian testing/unstable)
>Organization:
>Environment:
System: Linux burn 2.2.18 #1 Thu Dec 14 09:22:25 PST 2000 i686 unknown
Architecture: i686
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-x --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
C++ allows the word 'typename' after a 'using' directive. _The C++ Programming Language_ (third edition) [Stroustrup], section A.7 (Grammar/Declarations) defines the using directive:
using-declaration:
"using" "typename"(opt) "::"(opt) nested-name-specifier
unqualified-id ";"
>How-To-Repeat:
Attempt to compile the following:
struct C {
typedef int INT;
};
struct D : public C {
using typename C::INT;
};
int main() {
D::INT x = 666;
}
The compiler complains:
test.cc:6: parse error before `typename'
>Fix:
I'm not sure if there are cases in which the 'typename' portion is required. I've seen it in production code (the loki library, from _Modern C++ Design_ [Alexandrescu].
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/3033: 'using typename' construct doesn't work
@ 2001-06-01 19:36 Jonathan Adamczewski
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Adamczewski @ 2001-06-01 19:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/3033; it has been noted by GNATS.
From: "Jonathan Adamczewski" <jadamcze@utas.edu.au>
To: sethml@ofb.net
Cc: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: Re: c++/3033: 'using typename' construct doesn't work
Date: Sat, 2 Jun 2001 12:33:04 +1000 (EST)
>
> | OK, fine. The question remains: is this a legal construct, or not?
>
> The constructs you sent were all ill-formed. See 14.6/5 of the C++ definition text.
Or see C.13.5 in The C++ Programming Language 3rd Ed. (pp. 856-858)
j.
--
Put your leader at the back. This means there is less chance of his
head being knocked off. -- Generale tips for Captive
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/3033: 'using typename' construct doesn't work
@ 2001-06-01 18:46 Gabriel Dos Reis
0 siblings, 0 replies; 5+ messages in thread
From: Gabriel Dos Reis @ 2001-06-01 18:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/3033; it has been noted by GNATS.
From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: sethml@ofb.net
Cc: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>,
gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: Re: c++/3033: 'using typename' construct doesn't work
Date: 02 Jun 2001 03:44:10 +0200
sethml@ofb.net writes:
| > sethml@ofb.net writes:
| >
| > | C++ allows the word 'typename' after a 'using' directive. _The C++ Pro
| > gramming Language_ (third edition) [Stroustrup], section A.7 (Grammar/Declara
| > tions) defines the using directive:
| > | using-declaration:
| > | "using" "typename"(opt) "::"(opt) nested-name-specifier
| > | unqualified-id ";"
| >
| > The C++ grammar is not context-free, you cannot deduce construct
| > validity just from pure grammar productions.
|
| OK, fine. The question remains: is this a legal construct, or not?
The constructs you sent were all ill-formed. See 14.6/5 of the C++
definition text.
-- Gaby
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/3033: 'using typename' construct doesn't work
@ 2001-06-01 18:26 sethml
0 siblings, 0 replies; 5+ messages in thread
From: sethml @ 2001-06-01 18:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/3033; it has been noted by GNATS.
From: sethml@ofb.net
To: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
Cc: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: Re: c++/3033: 'using typename' construct doesn't work
Date: Fri, 01 Jun 2001 18:22:49 -0700
> sethml@ofb.net writes:
>
> | C++ allows the word 'typename' after a 'using' directive. _The C++ Pro
> gramming Language_ (third edition) [Stroustrup], section A.7 (Grammar/Declara
> tions) defines the using directive:
> | using-declaration:
> | "using" "typename"(opt) "::"(opt) nested-name-specifier
> | unqualified-id ";"
>
> The C++ grammar is not context-free, you cannot deduce construct
> validity just from pure grammar productions.
OK, fine. The question remains: is this a legal construct, or not?
Seth
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/3033: 'using typename' construct doesn't work
@ 2001-06-01 18:06 Gabriel Dos Reis
0 siblings, 0 replies; 5+ messages in thread
From: Gabriel Dos Reis @ 2001-06-01 18:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/3033; it has been noted by GNATS.
From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: sethml@ofb.net
Cc: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: Re: c++/3033: 'using typename' construct doesn't work
Date: 02 Jun 2001 02:58:27 +0200
sethml@ofb.net writes:
| C++ allows the word 'typename' after a 'using' directive. _The C++ Programming Language_ (third edition) [Stroustrup], section A.7 (Grammar/Declarations) defines the using directive:
| using-declaration:
| "using" "typename"(opt) "::"(opt) nested-name-specifier
| unqualified-id ";"
The C++ grammar is not context-free, you cannot deduce construct
validity just from pure grammar productions.
-- Gaby
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-06-01 19:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-01 13:46 c++/3033: 'using typename' construct doesn't work sethml
2001-06-01 18:06 Gabriel Dos Reis
2001-06-01 18:26 sethml
2001-06-01 18:46 Gabriel Dos Reis
2001-06-01 19:36 Jonathan Adamczewski
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).