diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2014-06-27 14:04:28 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2014-06-27 14:04:28 +0000 |
commit | 04d375e6046cdaa59d74f666c13570c6eb420cdc (patch) | |
tree | a232a238d4c69e7837ccfa5e853ddf9bb55fa583 /gcc | |
parent | 29d7cbd1b91cad56928674175507014d339689dc (diff) | |
download | gcc-04d375e6046cdaa59d74f666c13570c6eb420cdc.zip gcc-04d375e6046cdaa59d74f666c13570c6eb420cdc.tar.gz gcc-04d375e6046cdaa59d74f666c13570c6eb420cdc.tar.bz2 |
re PR c++/61614 (Bogus error: taking address of temporary array)
/cp
2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61614
* semantics.c (finish_compound_literal): Revert r204228.
/testsuite
2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61614
* g++.dg/ext/complit14.C: New.
From-SVN: r212073
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/complit14.C | 11 |
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e8aee0f..90ec8ad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com> + PR c++/61614 + * semantics.c (finish_compound_literal): Revert r204228. + +2014-06-27 Paolo Carlini <paolo.carlini@oracle.com> + * parser.c (cp_parser_compound_literal_p): New. (cp_parser_postfix_expression, cp_parser_sizeof_operand): Use it. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 241884c..456df7b 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 04d08b5..979f2e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-06-27 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/61614 + * g++.dg/ext/complit14.C: New. + 2014-06-27 Martin Jambor <mjambor@suse.cz> 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 0000000..aed765d --- /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 +} |