This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/3661: Parse error in template function using nested class of template argument



>Number:         3661
>Category:       c++
>Synopsis:       Parse error in template function using nested class of template argument
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 12 07:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Roy Norman
>Release:        3.0 and 2.96
>Organization:
>Environment:
System: SunOS heatwave 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

        <machine, os, target, libraries (multiple lines)>
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.0/configure --prefix=/bambi/ajl/extras --enable-threads : (reconfigured) ../gcc-3.0/configure --prefix=/ba
mbi/ajl/extras --enable-threads --enable-libgcj : (reconfigured) ../gcc-3.0/configure --prefix=/bambi/ajl/extras --enable-threads --
enable-libgcj
Also:
Linux jericho 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown
>Description:
Compile test.cpp below:

template<class T>
void foo()
{
    T::A anInner;
}

gcc -c -Wall test.cpp
emits:
test.cpp: In function `void foo ()':
test.cpp:4: parse error before `;'

Is this code legal or is it a bug?
KAI 3.4f and MSVC 6.0 accept this code.
>How-To-Repeat:

>Fix:

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]