re PR c++/79664 (ICE with #pragma omp parallel in constexpr function)
authorJakub Jelinek <jakub@redhat.com>
Wed, 22 Feb 2017 22:36:20 +0000 (23:36 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 22 Feb 2017 22:36:20 +0000 (23:36 +0100)
commite40b6fc7a16e78d6c806545dbe64430db003a66a
treee23a668b7cc255c235fd2264ebcb71d90ea00151
parentfe8ece053b4e3f5570881c774cd3f76b9fb41360
re PR c++/79664 (ICE with #pragma omp parallel in constexpr function)

PR c++/79664
* parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
* constexpr.c (potential_constant_expression_1): Handle
OMP_*, OACC_* and CILK_* trees.  Use error_at with
EXPR_LOC_OR_LOC (t, input_location) computed early
instead of error, or error_at with location_of (t).

* g++.dg/gomp/teams-1.C: Adjust expected diagnostic location.
* g++.dg/cpp1y/constexpr-throw.C: Likewise.
* g++.dg/gomp/pr79664.C: New test.

From-SVN: r245662
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
gcc/testsuite/g++.dg/gomp/pr79664.C [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/teams-1.C