+2017-01-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/68666 - member variable template-id
+ * typeck.c (finish_class_member_access_expr): Handle variable
+ template-id.
+ * pt.c (lookup_and_finish_template_variable): No longer static.
+ * cp-tree.h: Declare it.
+
2017-01-18 Nathan Sidwell <nathan@acm.org>
PR c++/78488
tsubst_flags_t);
extern tree finish_call_expr (tree, vec<tree, va_gc> **, bool,
bool, tsubst_flags_t);
+extern tree lookup_and_finish_template_variable (tree, tree, tsubst_flags_t = tf_warning_or_error);
extern tree finish_template_variable (tree, tsubst_flags_t = tf_warning_or_error);
extern cp_expr finish_increment_expr (cp_expr, enum tree_code);
extern tree finish_this_expr (void);
/* Construct a TEMPLATE_ID_EXPR for the given variable template TEMPL having
TARGS template args, and instantiate it if it's not dependent. */
-static tree
+tree
lookup_and_finish_template_variable (tree templ, tree targs,
tsubst_flags_t complain)
{
tree templ = member;
if (BASELINK_P (templ))
- templ = lookup_template_function (templ, template_args);
+ member = lookup_template_function (templ, template_args);
+ else if (variable_template_p (templ))
+ member = (lookup_and_finish_template_variable
+ (templ, template_args, complain));
else
{
if (complain & tf_error)
--- /dev/null
+// PR c++/68666
+// { dg-options "-std=c++1z -fconcepts" }
+
+struct A {
+ template <class>
+ static constexpr bool val = true;
+};
+
+template <class T>
+concept bool C = A::val<T>;
+
+C{T} struct B {};
--- /dev/null
+// { dg-do compile { target c++14 } }
+
+template <class T> struct A {
+ template <class U> static const U x = 1;
+ static const int y = 2;
+};
+
+int main() {
+ A<int> a;
+ int y = a.y; // OK
+ int x = a.x<int>; // ???
+}