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++/2185: (T()) not accepted as function argument



>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:


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