cp_apply_type_quals_to_decl (cp_type_quals (type), decl);
}
- if (is_global_var (decl))
- {
- type_context_kind context = (DECL_THREAD_LOCAL_P (decl)
- ? TCTX_THREAD_STORAGE
- : TCTX_STATIC_STORAGE);
- verify_type_context (input_location, context, TREE_TYPE (decl));
- }
-
if (initialized)
/* Is it valid for this decl to have an initializer at all? */
{
&& DECL_INITIALIZED_IN_CLASS_P (decl))
check_static_variable_definition (decl, type);
+ if (!processing_template_decl && VAR_P (decl) && is_global_var (decl))
+ {
+ type_context_kind context = (DECL_THREAD_LOCAL_P (decl)
+ ? TCTX_THREAD_STORAGE
+ : TCTX_STATIC_STORAGE);
+ verify_type_context (input_location, context, TREE_TYPE (decl));
+ }
+
if (init && TREE_CODE (decl) == FUNCTION_DECL)
{
tree clone;
--- /dev/null
+/* { dg-do compile } */
+
+#include <arm_sve.h>
+
+template <int N>
+void f()
+{
+ static svbool_t pg = svwhilelt_b64(0, N);
+}
+
+int main(int argc, char **argv)
+{
+ f<2>();
+ return 0;
+}
+
+/* { dg-error "SVE type 'svbool_t' does not have a fixed size" "" { target *-*-* } 0 } */