view gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

// { dg-options "-Wunused -pedantic-errors" }
// { dg-do compile { target c++11 } }
// Test for syntax support of various attribute permutations.

int
[[noreturn]] // { dg-warning "ignored" }
one
[[gnu::unused]]
(void);

int one_third [[noreturn]] [[gnu::unused]] (void);

int [[gnu::unused]] one_half(); // { dg-warning "ignored" }

static
[[noreturn]] // { dg-warning "ignored" }
void two [[gnu::unused]] (void) {}



[[gnu::unused]]
int
five(void)
[[noreturn]] // { dg-warning "does not apply to types" }
{ return 0; }

[[noreturn]]
void
six (void)
;