C++: improve location of static_assert errors
commitf2d40c101a2091b934eb04d042a3cfa4ff326e5d
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Nov 2017 22:07:32 +0000 (29 22:07 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Nov 2017 22:07:32 +0000 (29 22:07 +0000)
tree403022637b8440b706dd47ce33c9f34f8c21a943
parent069eebda309f9abc55813d09de13bd6c833b29bd
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255255 138bc75d-0d04-0410-961f-82ee72b054a4
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