Commit f64e8977 by Marek Polacek Committed by Marek Polacek

PR c++/90124 - bogus error with incomplete type in decltype.

	* typeck.c (build_class_member_access_expr): Check
	cp_unevaluated_operand.

	* g++.dg/cpp0x/decltype70.C: New test.

From-SVN: r270418
parent 62a64d0a
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
......
......@@ -2477,7 +2477,8 @@ build_class_member_access_expr (cp_expr object, tree member,
/* 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
......
// PR c++/90124
// { dg-do compile { target c++11 } }
class a {
public:
int b;
};
class c : a {
auto m_fn1() -> decltype(b);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment