diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-11 20:51:16 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-11 20:51:16 +0000 |
commit | 78cecf8ee4fa046e6c0808b4c43cd4901a0e0a98 (patch) | |
tree | f9b49b57950c4f011bc831074c00c11202b49c5a /gcc/cp/pt.c | |
parent | ba100e345ae840947fd2fcc438586feb118d2e8a (diff) |
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) <case VAR_DECL>: 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
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 6 |
1 files changed, 6 insertions, 0 deletions
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: |