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
This commit is contained in:
parent
29d7cbd1b9
commit
04d375e604
4 changed files with 21 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
11
gcc/testsuite/g++.dg/ext/complit14.C
Normal file
11
gcc/testsuite/g++.dg/ext/complit14.C
Normal file
|
@ -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
|
||||
}
|
Loading…
Add table
Reference in a new issue