diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e8aee0f9927..90ec8ad008b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-06-27 Paolo Carlini + + PR c++/61614 + * semantics.c (finish_compound_literal): Revert r204228. + 2014-06-27 Paolo Carlini * parser.c (cp_parser_compound_literal_p): New. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 241884cfffe..456df7b1bd8 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2607,7 +2607,6 @@ finish_compound_literal (tree type, tree compound_literal, if ((!at_function_scope_p () || CP_TYPE_CONST_P (type)) && TREE_CODE (type) == ARRAY_TYPE && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type) - && !cp_unevaluated_operand && initializer_constant_valid_p (compound_literal, type)) { tree decl = create_temporary_var (type); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 04d08b5a034..979f2e6b290 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-06-27 Paolo Carlini + + PR c++/61614 + * g++.dg/ext/complit14.C: New. + 2014-06-27 Martin Jambor PR ipa/61160 diff --git a/gcc/testsuite/g++.dg/ext/complit14.C b/gcc/testsuite/g++.dg/ext/complit14.C new file mode 100644 index 00000000000..aed765dc55d --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/complit14.C @@ -0,0 +1,11 @@ +// PR c++/61614 +// { dg-options "" } + +int Fn (...); + +void +Test () +{ + int j = Fn ((const int[]) { 0 }); // OK + unsigned long sz = sizeof Fn ((const int[]) { 0 }); // Error +}