2017-01-23 Nathan Sidwell <nathan@acm.org>
+ PR c++/71710 - template using directive of field
+ * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
+ check earlier.
+
PR c++/71406 - ICE with scope-ref'd template id exprs
PR c++/77508
* typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
if (member == error_mark_node)
RETURN (error_mark_node);
- if (type_dependent_expression_p (object))
+ if (TREE_CODE (member) == FIELD_DECL)
+ {
+ r = finish_non_static_data_member (member, object, NULL_TREE);
+ if (TREE_CODE (r) == COMPONENT_REF)
+ REF_PARENTHESIZED_P (r) = REF_PARENTHESIZED_P (t);
+ RETURN (r);
+ }
+ else if (type_dependent_expression_p (object))
/* We can't do much here. */;
else if (!CLASS_TYPE_P (object_type))
{
}
RETURN (error_mark_node);
}
- else if (TREE_CODE (member) == FIELD_DECL)
- {
- r = finish_non_static_data_member (member, object, NULL_TREE);
- if (TREE_CODE (r) == COMPONENT_REF)
- REF_PARENTHESIZED_P (r) = REF_PARENTHESIZED_P (t);
- RETURN (r);
- }
r = finish_class_member_access_expr (object, member,
/*template_p=*/false,
--- /dev/null
+// { dg-do compile { target c++11 } }
+// PR C++/71710 ICE with decltype & using
+
+template < typename > struct A
+{
+ A a;
+ template < int > using B = decltype (a);
+ B < 0 > b;
+ template < int C > B < C > foo ();
+};