re PR preprocessor/90382 (ICE in linemap_macro_map_loc_to_exp_point, at libcpp/line...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 9 May 2019 10:18:23 +0000 (10:18 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 9 May 2019 10:18:23 +0000 (10:18 +0000)
/cp
2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/90382
Revert:
2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
min_location.

/testsuite
2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/90382
2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/trailing1.C: New.

From-SVN: r271032

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/diagnostic/trailing1.C [deleted file]

index 9469602c5f5ce5245231a8af67eba270472ae727..2544e48c7d2352c66fb17c1502606496b2cf199c 100644 (file)
@@ -1,3 +1,12 @@
+2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/90382
+       Revert:
+       2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
+       min_location.
+
 2019-05-08  Nathan Sidwell  <nathan@acm.org>
 
        Kill DECL_SAVED_FUNCTION_DATA .
index 7f19d4a0b383a5e524d78ec0970706fa957be004..36014dc628eddb5b78e89da1fa6b32dc64fe94a7 100644 (file)
@@ -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;
 
index f03c44582fdd68a6402a295920dd67339dc27e61..98e102b0d669b4e36bbbf04707159a4a0e8e1ada 100644 (file)
@@ -1,3 +1,10 @@
+2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/90382
+       2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * g++.dg/diagnostic/trailing1.C: New.
+
 2019-05-09  Richard Biener  <rguenther@suse.de>
 
        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 (file)
index 369781e..0000000
+++ /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" }