This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 12 Aug 2016 12:51:18 +0000
- Subject: [Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-25814-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25814
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2006-03-08 05:07:27 |2016-8-12
CC| |manu at gcc dot gnu.org
--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Clang gives:
prog.cc:19:6: warning: parentheses were disambiguated as a function declaration
[-Wvexing-parse]
X x(Y());
^~~~~
prog.cc:19:7: note: add a pair of parentheses to declare a variable
X x(Y());
^
( )
1 warning generated.