Implement constexpr variable templates
[gcc.git] / gcc / cp / cp-tree.h
index 622de9c42f426ea6d699caeda9e3d957cf822944..ffb44d11ae5e874f20337aa2a820f63244f5db85 100644 (file)
@@ -5045,6 +5045,17 @@ class_of_this_parm (const_tree fntype)
   return TREE_TYPE (type_of_this_parm (fntype));
 }
 
+/* True if T designates a variable template declaration.  */
+inline bool
+variable_template_p (tree t)
+{
+  if (TREE_CODE (t) != TEMPLATE_DECL)
+    return false;
+  if (tree r = DECL_TEMPLATE_RESULT (t))
+    return VAR_P (r);
+  return false;
+}
+
 /* A parameter list indicating for a function with no parameters,
    e.g  "int f(void)".  */
 extern cp_parameter_declarator *no_parameters;
@@ -5572,6 +5583,7 @@ extern bool redeclare_class_template              (tree, tree);
 extern tree lookup_template_class              (tree, tree, tree, tree,
                                                 int, tsubst_flags_t);
 extern tree lookup_template_function           (tree, tree);
+extern tree lookup_template_variable           (tree, tree);
 extern int uses_template_parms                 (tree);
 extern int uses_template_parms_level           (tree, int);
 extern bool in_template_function               (void);
@@ -5834,6 +5846,7 @@ extern tree perform_koenig_lookup         (tree, vec<tree, va_gc> *,
                                                 tsubst_flags_t);
 extern tree finish_call_expr                   (tree, vec<tree, va_gc> **, bool,
                                                 bool, tsubst_flags_t);
+extern tree finish_template_variable   (tree);
 extern tree finish_increment_expr              (tree, enum tree_code);
 extern tree finish_this_expr                   (void);
 extern tree finish_pseudo_destructor_expr       (tree, tree, tree, location_t);