From 1ccebd3f730f29178b1f31c9e355943931909f80 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 9 May 2019 10:18:23 +0000 Subject: [PATCH] re PR preprocessor/90382 (ICE in linemap_macro_map_loc_to_exp_point, at libcpp/line-map.c:1061) /cp 2019-05-09 Paolo Carlini PR c++/90382 Revert: 2018-04-26 Paolo Carlini * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use min_location. /testsuite 2019-05-09 Paolo Carlini PR c++/90382 2018-04-26 Paolo Carlini * g++.dg/diagnostic/trailing1.C: New. From-SVN: r271032 --- gcc/cp/ChangeLog | 9 +++++++++ gcc/cp/decl.c | 4 ++-- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/g++.dg/diagnostic/trailing1.C | 5 ----- 4 files changed, 18 insertions(+), 7 deletions(-) delete mode 100644 gcc/testsuite/g++.dg/diagnostic/trailing1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9469602c5f5..2544e48c7d2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2019-05-09 Paolo Carlini + + PR c++/90382 + Revert: + 2018-04-26 Paolo Carlini + + * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use + min_location. + 2019-05-08 Nathan Sidwell Kill DECL_SAVED_FUNCTION_DATA . diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 7f19d4a0b38..36014dc628e 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10423,8 +10423,8 @@ grokdeclarator (const cp_declarator *declarator, location_t typespec_loc = smallest_type_quals_location (type_quals, declspecs->locations); - typespec_loc = min_location (typespec_loc, - declspecs->locations[ds_type_spec]); + if (typespec_loc == UNKNOWN_LOCATION) + typespec_loc = declspecs->locations[ds_type_spec]; if (typespec_loc == UNKNOWN_LOCATION) typespec_loc = input_location; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f03c44582fd..98e102b0d66 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2019-05-09 Paolo Carlini + + PR c++/90382 + 2018-04-26 Paolo Carlini + + * g++.dg/diagnostic/trailing1.C: New. + 2019-05-09 Richard Biener PR tree-optimization/90395 diff --git a/gcc/testsuite/g++.dg/diagnostic/trailing1.C b/gcc/testsuite/g++.dg/diagnostic/trailing1.C deleted file mode 100644 index 369781e56d5..00000000000 --- a/gcc/testsuite/g++.dg/diagnostic/trailing1.C +++ /dev/null @@ -1,5 +0,0 @@ -// { dg-do compile { target c++11 } } - -int const foo1() -> double; // { dg-error "1:.foo1. function with trailing return type" } -int volatile foo2() -> double; // { dg-error "1:.foo2. function with trailing return type" } -int const volatile foo3() -> double; // { dg-error "1:.foo3. function with trailing return type" } -- 2.30.2