Commit fa9ef321 by Jason Merrill Committed by Jason Merrill

semantics.c (finish_compound_literal): Don't put an array with a dtor in a static variable.

	* semantics.c (finish_compound_literal): Don't put an array
	with a dtor in a static variable.

From-SVN: r172810
parent f7029277
2011-04-20 Jason Merrill <jason@redhat.com>
* semantics.c (finish_compound_literal): Don't put an array
with a dtor in a static variable.
* call.c (build_over_call): Handle trivial dtor.
* search.c (lookup_fnfields_slot): Call complete_type.
......
......@@ -2383,6 +2383,7 @@ finish_compound_literal (tree type, tree compound_literal,
represent class temporaries with TARGET_EXPR so we elide copies. */
if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
&& TREE_CODE (type) == ARRAY_TYPE
&& !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
&& initializer_constant_valid_p (compound_literal, type))
{
tree decl = create_temporary_var (type);
......
2011-04-20 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/initlist47.C: New.
* g++.dg/init/dtor4.C: New.
2011-04-20 Uros Bizjak <ubizjak@gmail.com>
......
// { dg-options -std=c++0x }
struct A { ~A() = delete; }; // { dg-error "declared" }
int main()
{
typedef const A cA[2];
cA{}; // { dg-error "deleted" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment