[Bug c++/42701] [4.5 Regression] ICE on error recovery
------- 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
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply to: