Commit 1a013865 by Paolo Carlini Committed by Paolo Carlini

decl.c (check_array_designated_initializer): Use cp_expr_loc_or_input_loc in one place.

/cp
2019-08-06  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (check_array_designated_initializer): Use
	cp_expr_loc_or_input_loc in one place.

/testsuite
2019-08-06  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp0x/desig1.C: Check location too.

From-SVN: r274141
parent 3a961aea
2019-08-06 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (check_array_designated_initializer): Use
cp_expr_loc_or_input_loc in one place.
2019-08-06 Jakub Jelinek <jakub@redhat.com> 2019-08-06 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel * parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel
......
...@@ -5520,8 +5520,9 @@ check_array_designated_initializer (constructor_elt *ce, ...@@ -5520,8 +5520,9 @@ check_array_designated_initializer (constructor_elt *ce,
sorry ("non-trivial designated initializers not supported"); sorry ("non-trivial designated initializers not supported");
} }
else else
error ("C99 designator %qE is not an integral constant-expression", error_at (cp_expr_loc_or_input_loc (ce->index),
ce->index); "C99 designator %qE is not an integral constant-expression",
ce->index);
return false; return false;
} }
......
2019-08-06 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/desig1.C: Check location too.
2019-08-05 Marek Polacek <polacek@redhat.com> 2019-08-05 Marek Polacek <polacek@redhat.com>
DR 2413 - typename in conversion-function-ids. DR 2413 - typename in conversion-function-ids.
......
...@@ -25,5 +25,5 @@ struct C ...@@ -25,5 +25,5 @@ struct C
constexpr operator SE() const { return SE::se0; } constexpr operator SE() const { return SE::se0; }
}; };
int c[] = { [C()] = 0 }; // { dg-error "integral constant-expression" } int c[] = { [C()] = 0 }; // { dg-error "14:C99 designator .C\\\(\\\). is not an integral constant-expression" }
// { dg-warning "does not allow C99 designated initializers" "" { target *-*-* } .-1 } // { dg-warning "does not allow C99 designated initializers" "" { target *-*-* } .-1 }
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