Commit aaa94b3c by Paolo Carlini Committed by Paolo Carlini

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

/cp
2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>

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

/testsuite
2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r270597
parent 849ab78a
2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
min_location.
2019-04-24 Jason Merrill <jason@redhat.com>
PR c++/90227 - error with template parameter packs.
......
......@@ -10417,8 +10417,8 @@ grokdeclarator (const cp_declarator *declarator,
location_t typespec_loc = smallest_type_quals_location (type_quals,
declspecs->locations);
if (typespec_loc == UNKNOWN_LOCATION)
typespec_loc = declspecs->locations[ds_type_spec];
typespec_loc = min_location (typespec_loc,
declspecs->locations[ds_type_spec]);
if (typespec_loc == UNKNOWN_LOCATION)
typespec_loc = input_location;
......
2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/diagnostic/trailing1.C: New.
2019-04-26 Richard Sandiford <richard.sandiford@arm.com>
* gcc.dg/alias-16.c: New test.
......
// { 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