[Bug c++/52960] New: Missing warnings on ambiguous source : function decl vs local var decl
xinliangli at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Apr 12 22:08:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52960
Bug #: 52960
Summary: Missing warnings on ambiguous source : function decl
vs local var decl
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: xinliangli@gmail.com
struct S { int n; };
S bar();
S test() {
S foo,
bar();
// ...
return foo;
}
/*
conversions.cppreturn.cpvexing.cpp
vexing.cpp:5:6: warning: empty parentheses interpreted as a function
declaration [-Wvexing-parse]
bar();
^~
vexing.cpp:4:8: note: change this ',' to a ';' to call 'bar'
S foo,
^
;
vexing.cpp:5:6: note: replace parentheses with an initializer to declare
a variable
bar();
^~
{}
1 warning generated.
*/
More information about the Gcc-bugs
mailing list