19 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value %s2 3// Make sure diagnostics that we don't print based on runtime control4// flow are delayed correctly in cases where we can't immediately tell whether5// the context is unevaluated.6 7namespace std {8 class type_info;9}10 11int& NP(int);12void test1() { (void)typeid(NP(1 << 32)); }13 14class Poly { virtual ~Poly(); };15Poly& P(int);16void test2() { (void)typeid(P(1 << 32)); } // expected-warning {{shift count >= width of type}}17 18void test3() { 1 ? (void)0 : (void)typeid(P(1 << 32)); }19