diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2010-01-14 17:32:24 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-01-14 17:32:24 -0500 |
commit | 6700a2857f28074b6b388e6394a1c2599bfb7c17 (patch) | |
tree | da9b41ceca118191db9181a606d584a5a1aabff2 | |
parent | 2d1a618e84eaf3e747a1cf5bd6f936c91edc8374 (diff) | |
download | gcc-6700a2857f28074b6b388e6394a1c2599bfb7c17.zip gcc-6700a2857f28074b6b388e6394a1c2599bfb7c17.tar.gz gcc-6700a2857f28074b6b388e6394a1c2599bfb7c17.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/call.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/overload/error3.C | 41 |
4 files changed, 50 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1374a5b..c6e309f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 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 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 935aea8..54254c3 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -6256,11 +6256,10 @@ build_new_method_call (tree instance, tree fns, VEC(tree,gc) **args, permerror (input_location, "cannot call constructor %<%T::%D%> directly", basetype, name); - inform (input_location, "for a function-style cast, remove the " - "redundant %<::%D%>", name); + permerror (input_location, " for a function-style cast, remove the " + "redundant %<::%D%>", name); call = build_functional_cast (basetype, build_tree_list_vec (user_args), complain); - release_tree_vector (user_args); return call; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7c747c3..7c89ccd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,12 +1,15 @@ 2010-01-14 Jason Merrill <jason@redhat.com> + PR c++/42701 + * g++.dg/overload/error3.C: New. + PR c++/42655 * g++.dg/overload/rvalue1.C: New. 2010-01-14 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42706 - * gcc.dg/ipa/pr42706.c: New testcase. + * gcc.dg/ipa/pr42706.c: New testcase. 2010-01-14 H.J. Lu <hongjiu.lu@intel.com> diff --git a/gcc/testsuite/g++.dg/overload/error3.C b/gcc/testsuite/g++.dg/overload/error3.C new file mode 100644 index 0000000..e0003dd --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/error3.C @@ -0,0 +1,41 @@ +// 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"); + } +} |