C++: improve location of static_assert errors
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 29 Nov 2017 22:07:32 +0000 (22:07 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 29 Nov 2017 22:07:32 +0000 (22:07 +0000)
commit591996bad79b7b109bb01fba69b1c7acc054e287
tree403022637b8440b706dd47ce33c9f34f8c21a943
parentcc6fe784486b77d96bd4cb9cb1d6556c1d5480fb
C++: improve location of static_assert errors

gcc/cp/ChangeLog:
* parser.c (cp_parser_unary_expression): Generate a location for
"noexcept".
(cp_parser_trait_expr): Generate and return a location_t,
converting the return type from tree to cp_expr.
(cp_parser_static_assert): Pass location of the condition to
finish_static_assert, rather than that of the "static_assert"
token, where available.

gcc/testsuite/ChangeLog:
* g++.dg/cpp1y/static_assert3.C: New test case.

libstdc++-v3/ChangeLog:
* testsuite/20_util/duration/literals/range.cc: Update expected
line of a static_assert failure.

From-SVN: r255255
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/static_assert3.C [new file with mode: 0644]
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/duration/literals/range.cc