* typeck.c (build_class_member_access_expr): Check
cp_unevaluated_operand.
* g++.dg/cpp0x/decltype70.C: New test.
From-SVN: r270418
+2019-04-17 Marek Polacek <polacek@redhat.com>
+
+ PR c++/90124 - bogus error with incomplete type in decltype.
+ * typeck.c (build_class_member_access_expr): Check
+ cp_unevaluated_operand.
+
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
/* We didn't complain above about a currently open class, but now we
must: we don't know how to refer to a base member before layout is
complete. But still don't complain in a template. */
- if (!dependent_type_p (object_type)
+ if (!cp_unevaluated_operand
+ && !dependent_type_p (object_type)
&& !complete_type_or_maybe_complain (object_type, object,
complain))
return error_mark_node;
+2019-04-17 Marek Polacek <polacek@redhat.com>
+
+ PR c++/90124 - bogus error with incomplete type in decltype.
+ * g++.dg/cpp0x/decltype70.C: New test.
+
2019-04-17 Jakub Jelinek <jakub@redhat.com>
PR middle-end/90095
--- /dev/null
+// PR c++/90124
+// { dg-do compile { target c++11 } }
+
+class a {
+public:
+ int b;
+};
+class c : a {
+ auto m_fn1() -> decltype(b);
+};