From aaa94b3c890f4b43ecb8f1134ea0e4c6af75768d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 26 Apr 2019 11:46:15 +0000 Subject: decl.c (grokdeclarator): Fix value assigned to typespec_loc, use min_location. /cp 2018-04-26 Paolo Carlini * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use min_location. /testsuite 2018-04-26 Paolo Carlini * g++.dg/diagnostic/trailing1.C: New. From-SVN: r270597 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 059a7fd..c78683d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-04-26 Paolo Carlini + + * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use + min_location. + 2019-04-24 Jason Merrill PR c++/90227 - error with template parameter packs. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 01c89cd..49ab387 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; -- cgit v1.1