c++/9744: Explicit parameterization of templated return value fails within templated function
opiate@saturn5.com
opiate@saturn5.com
Tue Feb 18 15:36:00 GMT 2003
>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:
More information about the Gcc-bugs
mailing list