diff options
Diffstat (limited to 'gcc/cp/decl.cc')
| -rw-r--r-- | gcc/cp/decl.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 2089e4c..e2c20a3 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -7096,6 +7096,14 @@ maybe_deduce_size_from_array_init (tree decl, tree init) cp_apply_type_quals_to_decl (cp_type_quals (TREE_TYPE (decl)), decl); relayout_decl (decl); + + /* Update the type of the corresponding TEMPLATE_DECL to match. */ + if (DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)) + { + tree tmpl = template_for_substitution (decl); + if (DECL_TEMPLATE_RESULT (tmpl) == decl) + TREE_TYPE (tmpl) = TREE_TYPE (decl); + } } } |
