* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139956
138bc75d-0d04-0410-961f-
82ee72b054a4
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.
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.
--- /dev/null
+// 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" }
+};