This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42701] [4.5 Regression] ICE on error recovery
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2010 00:21:29 -0000
- Subject: [Bug c++/42701] [4.5 Regression] ICE on error recovery
- References: <bug-42701-11764@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from manu at gcc dot gnu dot org 2010-01-13 00:21 -------
The code warning:
155347 jason user_args = args == NULL ? NULL : *args;
155347 jason /* Under DR 147 A::A() is an invalid constructor call,
155347 jason not a functional cast. */
155347 jason if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn))
155347 jason {
155347 jason if (! (complain & tf_error))
155347 jason return error_mark_node;
155347 jason
155347 jason permerror (input_location,
155347 jason "cannot call constructor %<%T::%D%> directly",
155347 jason basetype, name);
155347 jason inform (input_location, "for a function-style cast,
remove the "
155347 jason "redundant %<::%D%>", name);
155347 jason call = build_functional_cast (basetype,
build_tree_list_vec (user_args),
155347 jason complain);
155347 jason release_tree_vector (user_args);
155347 jason return call;
155347 jason }
To avoid the spurious note, the code should use the idiom permerror() &&
inform(), since diagnostics functions that may be suppressed return false if
they don't print anything.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42701