[Bug c++/11418] implicit typename extension leads to wrong code
Don at Skyler dot com
gcc-bugzilla@gcc.gnu.org
Fri Jul 4 05:40:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11418
------- Additional Comments From Don at Skyler dot com 2003-07-04 05:40 -------
Subject: Re: implicit typename extension leads to wrong code
I didn't notice the missing "typename". I don't think gcc produced
the usual "implicit typenames deprecated" warning.
On 3 Jul 2003 16:45:49 -0000, you wrote:
>PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
>
>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11418
>
>
>bangerth at dealii dot org changed:
>
> What |Removed |Added
>----------------------------------------------------------------------------
> Status|UNCONFIRMED |RESOLVED
> Resolution| |FIXED
> Summary|Nested template as arg to |implicit typename extension
> |base class template confuses|leads to wrong code
> |args |
>
>
>------- Additional Comments From bangerth at dealii dot org 2003-07-03 16:45 -------
>Very interesting failure. In fact, I can confirm this with 3.2.x and 3.3,
>but it is fixed in mainline (see below).
>
>In essence: the code is wrong -- but previous versions of gcc accept
>it via the implicit typename extension. Here's the line:
> struct Derived : public Base<Outer<U>::Inner<T> > { };
>3.2 and 3.3 accept this line, but 3.4 rejects it, as it should
>read correctly as
> struct Derived : public Base<typename Outer<U>::template Inner<T> > { };
>
>Now, the amazing thing is that 3.2 and 3.3 generate the _wrong_ output for
>the first line, and the correct one for the second. Since 3.4 only accepts
>the last one, it always generates the correct output. Very interesting,
>indeed.
>
>So the proper workaround is to correct your code and don't rely on broken
>gcc extensions :-(
>
>Wolfgang
>
>
>
>------- You are receiving this mail because: -------
>You reported the bug, or are watching the reporter.
More information about the Gcc-bugs
mailing list