Commit 5b018c65 by Jason Merrill Committed by Jason Merrill

re PR c++/49092 (ice in tree_add_const_value_attribute)

	PR c++/49092
	* dwarf2out.c (tree_add_const_value_attribute_for_decl): Check for
	static storage duration.

From-SVN: r174024
parent b42bf620
2011-05-21 Jason Merrill <jason@redhat.com>
PR c++/49092
* dwarf2out.c (tree_add_const_value_attribute_for_decl): Check for
static storage duration.
2011-05-21 Eric Botcazou <ebotcazou@adacore.com> 2011-05-21 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sparc.md (setjmp): Handle PIC mode and use the hard * config/sparc/sparc.md (setjmp): Handle PIC mode and use the hard
......
...@@ -17719,7 +17719,9 @@ tree_add_const_value_attribute_for_decl (dw_die_ref var_die, tree decl) ...@@ -17719,7 +17719,9 @@ tree_add_const_value_attribute_for_decl (dw_die_ref var_die, tree decl)
if (!decl if (!decl
|| (TREE_CODE (decl) != VAR_DECL || (TREE_CODE (decl) != VAR_DECL
&& TREE_CODE (decl) != CONST_DECL)) && TREE_CODE (decl) != CONST_DECL)
|| (TREE_CODE (decl) == VAR_DECL
&& !TREE_STATIC (decl)))
return false; return false;
if (TREE_READONLY (decl) if (TREE_READONLY (decl)
......
2011-05-21 Jason Merrill <jason@redhat.com>
* g++.dg/debug/const5.C: New.
2011-05-20 Jason Merrill <jason@redhat.com> 2011-05-20 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/constexpr-static7.C: Extend. * g++.dg/cpp0x/constexpr-static7.C: Extend.
......
// PR c++/49092
struct A
{
A();
};
int i;
A::A()
{
const int j = i;
}
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