+2016-05-13 Jason Merrill <jason@redhat.com>
+
+ * parser.c (cp_parser_postfix_dot_deref_expression): Use
+ complete_type_or_else for unknown_type_node, too.
+
2016-05-12 Marek Polacek <polacek@redhat.com>
PR c/70756
underlying type here. */
scope = non_reference (scope);
/* The type of the POSTFIX_EXPRESSION must be complete. */
- if (scope == unknown_type_node)
- {
- error_at (location, "%qE does not have class type",
- postfix_expression.get_value ());
- scope = NULL_TREE;
- }
/* Unlike the object expression in other contexts, *this is not
required to be of complete type for purposes of class member
access (5.2.5) outside the member function body. */
- else if (postfix_expression != current_class_ref
- && !(processing_template_decl && scope == current_class_type))
- scope = complete_type_or_else (scope, NULL_TREE);
+ if (postfix_expression != current_class_ref
+ && !(processing_template_decl && scope == current_class_type))
+ scope = complete_type_or_else (scope, postfix_expression);
/* Let the name lookup machinery know that we are processing a
class member access expression. */
parser->context->object_type = scope;
// { dg-do compile }
struct S; // { dg-message "forward declaration" }
-#pragma omp declare reduction (+:S:omp_out.s += omp_in.s) // { dg-error "invalid use of incomplete type" }
+#pragma omp declare reduction (+:S:omp_out.s += omp_in.s) // { dg-error "incomplete type" }
struct S { int s; S () : s (1) {} };
#pragma omp declare reduction (*:S:omp_out.s *= omp_in.s)