xref: /aosp_15_r20/external/clang/test/SemaCXX/runtimediag-ppe.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value %s
2*67e74705SXin Li 
3*67e74705SXin Li // Make sure diagnostics that we don't print based on runtime control
4*67e74705SXin Li // flow are delayed correctly in cases where we can't immediately tell whether
5*67e74705SXin Li // the context is unevaluated.
6*67e74705SXin Li 
7*67e74705SXin Li namespace std {
8*67e74705SXin Li   class type_info;
9*67e74705SXin Li }
10*67e74705SXin Li 
11*67e74705SXin Li int& NP(int);
test1()12*67e74705SXin Li void test1() { (void)typeid(NP(1 << 32)); }
13*67e74705SXin Li 
14*67e74705SXin Li class Poly { virtual ~Poly(); };
15*67e74705SXin Li Poly& P(int);
test2()16*67e74705SXin Li void test2() { (void)typeid(P(1 << 32)); } // expected-warning {{shift count >= width of type}}
17*67e74705SXin Li 
test3()18*67e74705SXin Li void test3() { 1 ? (void)0 : (void)typeid(P(1 << 32)); }
19