aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-09 22:03:07 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-09 22:03:07 +0000
commit80488e2094d1e6b60c377b5742370110f683d8ce (patch)
treeaff9bbf2a3b0a1784c16e435791500d42f2046d1 /gcc/cp/semantics.c
parent44f01555a3a25d45412bce2cfe6c85468445e3ea (diff)
PR c++/68703 - bogus error with dependent vector length
gcc/c-family/ * c-common.c (c_common_attribute_table): vector_size affects type identity. gcc/cp/ * decl2.c (any_dependent_type_attributes_p): New. * pt.c (dependent_type_p_r, type_dependent_expression_p): Check it. * semantics.c (finish_id_expression): Check it. * typeck.c (finish_class_member_access_expr): Check it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239309 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 4bffe6dc851..bffdddbb965 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3548,6 +3548,12 @@ finish_id_expression (tree id_expression,
resolve the name at instantiation time. */
if (dependent_p)
{
+ if (DECL_P (decl)
+ && any_dependent_type_attributes_p (DECL_ATTRIBUTES (decl)))
+ /* Dependent type attributes on the decl mean that the TREE_TYPE is
+ wrong, so just return the identifier. */
+ return id_expression;
+
/* If we found a variable, then name lookup during the
instantiation will always resolve to the same VAR_DECL
(or an instantiation thereof). */