Commit 6700a285 by Jason Merrill

re PR c++/42701 (ICE on error recovery)

	PR c++/42701
	* call.c (build_new_method_call): Don't free the vec here.

From-SVN: r155916
parent 2d1a618e
2010-01-14 Jason Merrill <jason@redhat.com> 2010-01-14 Jason Merrill <jason@redhat.com>
PR c++/42701
* call.c (build_new_method_call): Don't free the vec here.
PR c++/42655 PR c++/42655
* call.c (convert_like_real): Do full decay_conversion for ck_rvalue. * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
......
...@@ -6256,11 +6256,10 @@ build_new_method_call (tree instance, tree fns, VEC(tree,gc) **args, ...@@ -6256,11 +6256,10 @@ build_new_method_call (tree instance, tree fns, VEC(tree,gc) **args,
permerror (input_location, permerror (input_location,
"cannot call constructor %<%T::%D%> directly", "cannot call constructor %<%T::%D%> directly",
basetype, name); basetype, name);
inform (input_location, "for a function-style cast, remove the " permerror (input_location, " for a function-style cast, remove the "
"redundant %<::%D%>", name); "redundant %<::%D%>", name);
call = build_functional_cast (basetype, build_tree_list_vec (user_args), call = build_functional_cast (basetype, build_tree_list_vec (user_args),
complain); complain);
release_tree_vector (user_args);
return call; return call;
} }
......
2010-01-14 Jason Merrill <jason@redhat.com> 2010-01-14 Jason Merrill <jason@redhat.com>
PR c++/42701
* g++.dg/overload/error3.C: New.
PR c++/42655 PR c++/42655
* g++.dg/overload/rvalue1.C: New. * g++.dg/overload/rvalue1.C: New.
......
// PR c++/42701
// Test for error-recovery on code that is ill-formed by DR 147.
namespace Glib {
class ustring {
public:
typedef unsigned size_type;
ustring(const char* src, size_type n);
ustring(const char* src);
};
}
namespace Gdk {
class Color {
public:
explicit Color(const Glib::ustring& value);
};
}
namespace Gtk {
enum StateType { STATE_NORMAL };
class Widget {
public:
void modify_bg(StateType state, const Gdk::Color& color);
};
class Label {
public:
void set_text(const Glib::ustring &str);
};
}
typedef enum Result { eSuccess = 0 } Result;
class MainWindow {
void update_status(Result result);
Gtk::Widget status_frame;
Gtk::Label status_label;
};
void MainWindow::update_status(Result result) {
switch (result) {
status_frame.modify_bg(Gtk::STATE_NORMAL,Gdk::Color::Color("green")); // { dg-error "" }
status_frame.modify_bg(Gtk::STATE_NORMAL,Gdk::Color::Color("red")); // { dg-error "" }
status_label.set_text("Out of memory");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment