Commit 3e03c959 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/37348 (internal compiler error: tree check: expected var_decl, have…

re PR c++/37348 (internal compiler error: tree check: expected var_decl, have field_decl in cp_finish_decl, at cp/decl.c:5461)

	PR c++/37348
	* decl.c (cp_finish_decl): Only set
	DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL.

	* g++.dg/parse/crash45.C: New test.

From-SVN: r139956
parent 3368cdd3
2008-09-03 Jakub Jelinek <jakub@redhat.com>
PR c++/37348
* decl.c (cp_finish_decl): Only set
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL.
PR c++/37189
* cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): New
extern decls.
......
......@@ -5517,7 +5517,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
DECL_INITIAL (decl) = NULL_TREE;
}
if (init && init_const_expr_p)
if (init && init_const_expr_p && TREE_CODE (decl) == VAR_DECL)
{
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = 1;
if (DECL_INTEGRAL_CONSTANT_VAR_P (decl))
......
2008-09-03 Jakub Jelinek <jakub@redhat.com>
PR c++/37348
* g++.dg/parse/crash45.C: New test.
PR c++/37189
* g++.dg/gomp/pr37189.C: New test.
......
// PR c++/37348
// { dg-do compile }
struct A
{
template <class> int f (B); // { dg-error "was not declared in this scope|cannot be a member template" }
};
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