public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4315: GCC giver parse error for valid code inside a template
@ 2001-09-14 6:47 lerdsuwa
0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa @ 2001-09-14 6:47 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, matti.rintala, nobody
Synopsis: GCC giver parse error for valid code inside a template
State-Changed-From-To: open->closed
State-Changed-By: lerdsuwa
State-Changed-When: Fri Sep 14 06:47:01 2001
State-Changed-Why:
Duplicate of bug PR3012.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4315&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
* c++/4315: GCC giver parse error for valid code inside a template
@ 2001-09-13 4:06 matti.rintala
0 siblings, 0 replies; 2+ messages in thread
From: matti.rintala @ 2001-09-13 4:06 UTC (permalink / raw)
To: gcc-gnats; +Cc: matti.rintala
>Number: 4315
>Category: c++
>Synopsis: GCC giver parse error for valid code inside a template
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Sep 13 04:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Matti Rintala
>Release: 3.0.1
>Organization:
Tampere University of Technology
>Environment:
System: Linux pulu.cs.tut.fi 2.4.9 #1 Fri Aug 24 11:24:56 EEST 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.0.1/configure --prefix=/usr/local/gcc-3.0.1 --enable-shared --enable-threads --enable-cpp --with-cpu=i686
>Description:
The following small program gives a parse error, although it's legal.
Curiously enough, the error only occurs inside a template function. If
the same code is inside a normal function, no error occurs.
>How-To-Repeat:
The following program:
-----------
class X
{
public:
template<typename T>
void m();
};
void f()
{
X x;
X* p = &x;
p->m<int>();
}
template<typename Q>
void t(Q q)
{
X x;
X* p = &x;
p->m<int>(); // This line gives a parse error
}
-------------
gives the following error when compiled with -v:
Reading specs from /usr/local/gcc3/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs
Configured with: ../gcc-3.0.1/configure --prefix=/usr/local/gcc-3.0.1 --enable-shared --enable-threads --enable-cpp --with-cpu=i686
Thread model: posix
gcc version 3.0.1
/usr/local/gcc3/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cc1plus -v -iprefix /usr/local/gcc3/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0.1/ -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ virhe.cc -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase virhe.cc -version -o /tmp/cctiwNsA.s
GNU CPP version 3.0.1 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.0.1.
ignoring nonexistent directory "/usr/local/gcc3/i686-pc-linux-gnu/include"
ignoring nonexistent directory "/usr/local/gcc-3.0.1/i686-pc-linux-gnu/include"
ignoring duplicate directory "/usr/local/gcc-3.0.1/include/g++-v3"
ignoring duplicate directory "/usr/local/gcc-3.0.1/include/g++-v3/i686-pc-linux-gnu"
ignoring duplicate directory "/usr/local/gcc-3.0.1/include/g++-v3/backward"
ignoring duplicate directory "/usr/local/gcc-3.0.1/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/gcc3/include/g++-v3
/usr/local/gcc3/include/g++-v3/i686-pc-linux-gnu
/usr/local/gcc3/include/g++-v3/backward
/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include
/usr/local/include
/usr/include
End of search list.
virhe.cc: In function `void t(Q)':
virhe.cc:20: parse error before `>' token
---------------
I also tried with a quite recent CVS snapshot and the same problem occurred.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-14 6:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-14 6:47 c++/4315: GCC giver parse error for valid code inside a template lerdsuwa
-- strict thread matches above, loose matches on Subject: below --
2001-09-13 4:06 matti.rintala
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).