public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9744: Explicit parameterization of templated return value fails within templated function
@ 2003-02-18 15:36 opiate
0 siblings, 0 replies; 2+ messages in thread
From: opiate @ 2003-02-18 15:36 UTC (permalink / raw)
To: gcc-gnats
>Number: 9744
>Category: c++
>Synopsis: Explicit parameterization of templated return value fails within templated function
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Feb 18 15:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Ryan Daum
>Release: gcc 3.2.3 20030210 (Debian prerelease) and 3.04 and 2.95.4
>Organization:
>Environment:
>Description:
When compiling:
class Example
{
public:
Example() { }
template<typename R>
R apply( void ) const {
return R ();
}
};
template <typename GCC_BUG>
void foo () {
Example x;
x.apply<bool>();
}
Errors:
g++ -c -o break-gcc.o break-gcc.cpp
break-gcc.cc: In function `void foo()':
break-gcc.cc:15: syntax error before `>' token
Same code compiles without incident in Intel's CC, and appears (from my reading and others) to be legal standard C++. This problem appears to occur in all GCC releases that I have tried (2.95, 3.0 and 3.2)
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/9744: Explicit parameterization of templated return value fails within templated function
@ 2003-02-18 15:43 bangerth
0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-02-18 15:43 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, opiate
Synopsis: Explicit parameterization of templated return value fails within templated function
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Tue Feb 18 15:43:43 2003
State-Changed-Why:
Already fixed for 3.4. In the meantime, you can work
around this by writing
x.template apply<bool>();
Wolfgang
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9744
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-02-18 15:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-18 15:36 c++/9744: Explicit parameterization of templated return value fails within templated function opiate
2003-02-18 15:43 bangerth
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).