xref: /aosp_15_r20/external/clang/test/SemaCXX/value-dependent-exprs.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -verify %s
2*67e74705SXin Li // expected-no-diagnostics
3*67e74705SXin Li 
4*67e74705SXin Li template <unsigned I>
5*67e74705SXin Li class C0 {
6*67e74705SXin Li   static const int iv0 = 1 << I;
7*67e74705SXin Li 
8*67e74705SXin Li   enum {
9*67e74705SXin Li     A = I,
10*67e74705SXin Li     B = I + 1
11*67e74705SXin Li   };
12*67e74705SXin Li 
13*67e74705SXin Li   struct s0 {
14*67e74705SXin Li     int a : I;
15*67e74705SXin Li     int b[I];
16*67e74705SXin Li   };
17*67e74705SXin Li 
18*67e74705SXin Li   // FIXME: I'm unclear where the right place to handle this is.
19*67e74705SXin Li #if 0
20*67e74705SXin Li   void f0(int *p) {
21*67e74705SXin Li     if (p == I) {
22*67e74705SXin Li     }
23*67e74705SXin Li   }
24*67e74705SXin Li #endif
25*67e74705SXin Li 
26*67e74705SXin Li #if 0
27*67e74705SXin Li   // FIXME: Not sure whether we care about these.
28*67e74705SXin Li   void f1(int *a)
29*67e74705SXin Li     __attribute__((nonnull(1 + I)))
30*67e74705SXin Li     __attribute__((constructor(1 + I)))
31*67e74705SXin Li     __attribute__((destructor(1 + I)))
32*67e74705SXin Li     __attribute__((sentinel(1 + I, 2 + I))),
33*67e74705SXin Li     __attribute__((reqd_work_group_size(1 + I, 2 + I, 3 + I))),
34*67e74705SXin Li     __attribute__((format_arg(1 + I))),
35*67e74705SXin Li     __attribute__((aligned(1 + I))),
36*67e74705SXin Li     __attribute__((regparm(1 + I)));
37*67e74705SXin Li 
38*67e74705SXin Li   typedef int int_a0 __attribute__((address_space(1 + B)));
39*67e74705SXin Li #endif
40*67e74705SXin Li 
41*67e74705SXin Li #if 0
42*67e74705SXin Li   // FIXME: This doesn't work. PR4996.
43*67e74705SXin Li   int f2() {
44*67e74705SXin Li     return __builtin_choose_expr(I, 1, 2);
45*67e74705SXin Li   }
46*67e74705SXin Li #endif
47*67e74705SXin Li 
48*67e74705SXin Li };
49