Commit 4593483f by Paolo Carlini Committed by Martin Liska

Reapply r270597.

2019-05-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR preprocessor/90382
	* decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
	min_location.
2019-05-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR preprocessor/90382
	* g++.dg/diagnostic/trailing1.C: New test.

From-SVN: r271164
parent 19eda56d
2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
PR preprocessor/90382
* decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
min_location.
2019-05-13 Jason Merrill <jason@redhat.com> 2019-05-13 Jason Merrill <jason@redhat.com>
Use releasing_vec more broadly. Use releasing_vec more broadly.
......
...@@ -10424,8 +10424,8 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -10424,8 +10424,8 @@ grokdeclarator (const cp_declarator *declarator,
location_t typespec_loc = smallest_type_quals_location (type_quals, location_t typespec_loc = smallest_type_quals_location (type_quals,
declspecs->locations); declspecs->locations);
if (typespec_loc == UNKNOWN_LOCATION) typespec_loc = min_location (typespec_loc,
typespec_loc = declspecs->locations[ds_type_spec]; declspecs->locations[ds_type_spec]);
if (typespec_loc == UNKNOWN_LOCATION) if (typespec_loc == UNKNOWN_LOCATION)
typespec_loc = input_location; typespec_loc = input_location;
......
2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
PR preprocessor/90382
* g++.dg/diagnostic/trailing1.C: New test.
2019-05-14 marxin <mliska@suse.cz> 2019-05-14 marxin <mliska@suse.cz>
PR middle-end/90340 PR middle-end/90340
......
// { 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" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment