C++ PATCH for c++/83820 - excessive attribute arguments not detected

Iain Sandoe iain@sandoe.co.uk
Tue Jun 25 11:28:00 GMT 2019


Hi Dominique,

> On 25 Jun 2019, at 12:10, Dominique d'Humières <dominiq@lps.ens.fr> wrote:
> 
> On darwin* I see
> 
> FAIL: g++.dg/cpp0x/gen-attrs-67.C  -std=c++14 (test for excess errors)
> FAIL: g++.dg/cpp0x/gen-attrs-67.C  -std=c++17 (test for excess errors)
> 
> This is caused by the additional error
> 
> /opt/gcc/_clean/gcc/testsuite/g++.dg/cpp0x/gen-attrs-67.C:11:34: error: constructor priorities are not supported
>   11 | [[gnu::constructor(101)]] int f7();
> 
> and it is fixed by the following patch
> 
> --- ../_clean/gcc/testsuite/g++.dg/cpp0x/gen-attrs-67.C	2019-06-17 20:33:15.000000000 +0200
> +++ gcc/testsuite/g++.dg/cpp0x/gen-attrs-67.C	2019-06-20 18:13:13.000000000 +0200
> @@ -8,4 +8,4 @@
> [[nodiscard()]] int f4(); // { dg-error ".nodiscard. attribute does not take any arguments" }
> [[gnu::noinline()]] int f5(); // { dg-error ".noinline. attribute does not take any arguments" }
> [[gnu::constructor]] int f6();
> -[[gnu::constructor(101)]] int f7();
> +[[gnu::constructor(101)]] int f7(); // { dg-error "constructor priorities are not supported" { target *-*-darwin* } }

I think this needs to be:

+[[gnu::constructor(101)]] int f7(); // { dg-error "constructor priorities are not supported" "" { target *-*-darwin* } . }

or it will fail on other targets,

OK from a Darwin pov with that change.
Iain




More information about the Gcc-patches mailing list