decl2.c (grokvardecl): Add location_t parameter and use it in build_lang_decl_loc and build_decl calls.

/cp
2018-12-11  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl2.c (grokvardecl): Add location_t parameter and use it
	in build_lang_decl_loc and build_decl calls.
	(grokdeclarator): Move up loc declaration and use it in the
	grokvardecl call too.

/testsuite
2018-12-11  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/pr53037-4.C: Test the first two locations too.

From-SVN: r267027
This commit is contained in:
Paolo Carlini 2018-12-11 17:46:42 +00:00 committed by Paolo Carlini
parent ccef67160c
commit 296e379a50
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2018-12-11 Paolo Carlini <paolo.carlini@oracle.com>
* decl2.c (grokvardecl): Add location_t parameter and use it
in build_lang_decl_loc and build_decl calls.
(grokdeclarator): Move up loc declaration and use it in the
grokvardecl call too.
2018-12-09 Cesar Philippidis <cesar@codesourcery.com> 2018-12-09 Cesar Philippidis <cesar@codesourcery.com>
* parser.c (cp_parser_oacc_kernels_parallel): Adjust EXPR_LOCATION * parser.c (cp_parser_oacc_kernels_parallel): Adjust EXPR_LOCATION

View File

@ -1,3 +1,7 @@
2018-12-11 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/pr53037-4.C: Test the first two locations too.
2018-12-11 Jakub Jelinek <jakub@redhat.com> 2018-12-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/88444 PR tree-optimization/88444

View File

@ -2,11 +2,11 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O0" } */ /* { dg-options "-O0" } */
int foo1 __attribute__((warn_if_not_aligned(8))); /* { dg-error "'warn_if_not_aligned' may not be specified for 'foo1'" } */ int foo1 __attribute__((warn_if_not_aligned(8))); /* { dg-error "5:'warn_if_not_aligned' may not be specified for 'foo1'" } */
__attribute__((warn_if_not_aligned(8))) __attribute__((warn_if_not_aligned(8)))
void void
foo2 (void) /* { dg-error "'warn_if_not_aligned' may not be specified for 'void foo2\\(\\)'" } */ foo2 (void) /* { dg-error "1:'warn_if_not_aligned' may not be specified for 'void foo2\\(\\)'" } */
{ {
} }