PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / attributes-enum-1.C
blob3bd1ba1929d9719eabd46bae45eb8552c9ec69cc
1 // PR c/47043
2 // { dg-do compile { target c++14 } }
4 class C
6 public:
7   enum Foo
8   {
9     T,
10     U [[deprecated("unused")]],
11     V
12   };
15 template<typename Tp>
16   class D
17   {
18   public:
19     enum Bar
20     {
21       X,
22       Y [[deprecated("unused")]],
23       Z
24     };
25   };
27 int
28 f (int i)
30   auto j = C::U; // { dg-warning ".U. is deprecated" }
32   auto k = D<int>::Y; // { dg-warning ".Y. is deprecated" }
34   return i;