This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11253] New: Parsing error with anonymous class instantiation
- From: "marko at ixiacom dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jun 2003 16:53:23 -0000
- Subject: [Bug c++/11253] New: Parsing error with anonymous class instantiation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11253
Summary: Parsing error with anonymous class instantiation
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: marko@ixiacom.com
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: i386-redhat-linux
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
This legal program compiles fine:
#include <sstream>
int main(int argc,const char *const argv[])
{
int x;
(std::istringstream(argv[1])) >> x;
return x;
}
but removing the redundant parentheses:
#include <sstream>
int main(int argc,const char *const argv[])
{
int x;
std::istringstream(argv[1]) >> x;
return x;
}
causes gcc to generate this diagnostic output:
prog.C: In function `int main(int, const char* const*)':
prog.C:6: declaration of `argv' shadows a parameter
prog.C:6: parse error before `>>' token
It appears gcc thinks a function is being declared.