This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/2185: (T()) not accepted as function argument
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/2185: (T()) not accepted as function argument
- From: rene at cs dot uu dot nl
- Date: 5 Mar 2001 19:44:30 -0000
- Reply-To: rene at cs dot uu dot nl
>Number: 2185
>Category: c++
>Synopsis: (T()) not accepted as function argument
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Mar 05 11:46:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Rene van Oostrum
>Release: gcc version 2.96 20000731
>Organization:
>Environment:
Red Hat Linux 7.0
>Description:
g++ failes to accept (T()) as an argument of a function
(or operator, such as sizeof) that expects a T:
t.cpp: In function `int main ()':
t.cpp:2: parse error before `)'
>How-To-Repeat:
int main(){
(void) sizeof( ( int() ) );
}
>Fix:
Trivial for the above code, but I need the mechanism to work
in templated code without a T actually being created. I know
of no workaround for this.
>Release-Note:
>Audit-Trail:
>Unformatted: