aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 5917503..3e1a0bf 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5456,6 +5456,15 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p,
}
}
+ if (cxx_dialect >= cxx1y && array_of_runtime_bound_p (type))
+ {
+ if (complain & tf_warning_or_error)
+ pedwarn (input_location, OPT_Wvla,
+ "taking decltype of array of runtime bound");
+ else
+ return error_mark_node;
+ }
+
return type;
}