1 // PR c++/63265 2 // { dg-do compile { target c++11 } } 3 4 #define LSHIFT (sizeof(unsigned int) * __CHAR_BIT__) 5 6 template <int lshift> 7 struct SpuriouslyWarns1 { 8 static constexpr unsigned int v = lshift < LSHIFT ? 1U << lshift : 0; 9 }; 10 11 static_assert(SpuriouslyWarns1<LSHIFT>::v == 0, "Impossible occurred"); 12 13 template <int lshift> 14 struct SpuriouslyWarns2 { 15 static constexpr bool okay = lshift < LSHIFT; 16 static constexpr unsigned int v = okay ? 1U << lshift : 0; 17 }; 18 19 static_assert(SpuriouslyWarns2<LSHIFT>::v == 0, "Impossible occurred"); 20