aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/attr-no-dangling4.C
blob: e910723d9852f92914bf84130a80106f56e50ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// { dg-do compile { target c++11 } }

#if !__has_attribute(no_dangling)
#error unsupported
#endif

#ifdef __has_cpp_attribute
# if !__has_cpp_attribute(no_dangling)
#  error no_dangling
# endif
#endif

struct [[gnu::no_dangling]] S { };
static_assert (__builtin_has_attribute (S, no_dangling), "");