From: Paolo Carlini Date: Tue, 26 Jul 2011 20:00:31 +0000 (+0000) Subject: re PR c++/49776 ([C++0x]ICE in build_data_member_initialization, at cp/semantics... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=625f85e91b9b91fc3d82416abf7e00f556e6e6da;p=gcc.git re PR c++/49776 ([C++0x]ICE in build_data_member_initialization, at cp/semantics.c:5499) /cp 2011-07-26 Paolo Carlini PR c++/49776 * typeck.c (cp_build_modify_expr): Check digest_init return value for error_mark_node. /testsuite 2011-07-26 Paolo Carlini PR c++/49776 * g++.dg/cpp0x/constexpr-49776.C: New. From-SVN: r176809 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fe6b7da9c8b..d169ed14a33 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-07-26 Paolo Carlini + + PR c++/49776 + * typeck.c (cp_build_modify_expr): Check digest_init return value + for error_mark_node. + 2011-07-25 Paolo Carlini PR bootstrap/49845 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 52084e6ae40..ab08eae2859 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6753,6 +6753,8 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, if (check_array_initializer (lhs, lhstype, newrhs)) return error_mark_node; newrhs = digest_init (lhstype, newrhs, complain); + if (newrhs == error_mark_node) + return error_mark_node; } else if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b201960d301..f0cb44b5167 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-26 Paolo Carlini + + PR c++/49776 + * g++.dg/cpp0x/constexpr-49776.C: New. + 2011-07-26 Sebastian Pop PR middle-end/47046 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-49776.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-49776.C new file mode 100644 index 00000000000..3fe3dcb86c1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-49776.C @@ -0,0 +1,17 @@ +// PR c++/49776 +// { dg-options -std=c++0x } + +struct s +{ + int i[1]; + + template + constexpr s(Types... args) + : i{args...} // { dg-error "cannot convert" } + { } +}; + +int main() +{ + s test = nullptr; +}