From 78cecf8ee4fa046e6c0808b4c43cd4901a0e0a98 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 11 Apr 2017 20:51:16 +0000 Subject: PR c++/80370 * decl.c (cp_finish_decomp): If processing_template_decl on non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst processing. * pt.c (value_dependent_expression_p) : For variables with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type dependent. * g++.dg/cpp1z/decomp28.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246857 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/pt.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/cp/pt.c') diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5a55f179096..862c2c2c08c 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -23576,6 +23576,12 @@ value_dependent_expression_p (tree expression) || type_dependent_expression_p (DECL_INITIAL (expression)) || value_dependent_expression_p (DECL_INITIAL (expression)))) return true; + if (DECL_HAS_VALUE_EXPR_P (expression)) + { + tree value_expr = DECL_VALUE_EXPR (expression); + if (type_dependent_expression_p (value_expr)) + return true; + } return false; case DYNAMIC_CAST_EXPR: -- cgit v1.2.3