diff options
author | Jason Merrill <jason@redhat.com> | 2010-04-07 11:55:20 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-04-07 11:55:20 -0400 |
commit | 483264879c177c32f0197992f4625dbca09d444b (patch) | |
tree | a5b7680b208ae794f76af4b1d4f4f2e185f2f4a9 /gcc/cp/semantics.c | |
parent | ae099258d3654e328fca96e0ebd457487a70a685 (diff) | |
download | gcc-483264879c177c32f0197992f4625dbca09d444b.zip gcc-483264879c177c32f0197992f4625dbca09d444b.tar.gz gcc-483264879c177c32f0197992f4625dbca09d444b.tar.bz2 |
PR c++/11094, DR 408
PR c++/11094, DR 408
* cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
* decl2.c (finish_static_data_member_decl): Set it.
* decl.c (duplicate_decls): Propagate it.
* pt.c (tsubst_decl): Don't substitute the domain of an array
VAR_DECL if it's set.
(regenerate_decl_from_template): Substitute it here.
(type_dependent_expression_p): Return true if it's set.
* semantics.c (finish_decltype_type): Instantiate such a variable.
* typeck.c (cxx_sizeof_expr): Likewise.
(strip_array_domain): New.
From-SVN: r158075
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 5cf4b69..d425402 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -4836,6 +4836,14 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p) /* The type denoted by decltype(e) is defined as follows: */ expr = resolve_nondeduced_context (expr); + + /* To get the size of a static data member declared as an array of + unknown bound, we need to instantiate it. */ + if (TREE_CODE (expr) == VAR_DECL + && VAR_HAD_UNKNOWN_BOUND (expr) + && DECL_TEMPLATE_INSTANTIATION (expr)) + instantiate_decl (expr, /*defer_ok*/true, /*expl_inst_mem*/false); + if (id_expression_or_member_access_p) { /* If e is an id-expression or a class member access (5.2.5 |