p2-0x.cpp revision 63fe6814f339df30b8463b39995947cbdf920e48
1// RUN: %clang_cc1 -fsyntax-only -std=c++0x -verify %s 2 3// PR9999 4template<bool v> 5class bitWidthHolding { 6public: 7 static const 8 unsigned int width = (v == 0 ? 0 : bitWidthHolding<(v >> 1)>::width + 1); 9}; 10 11static const int width=bitWidthHolding<255>::width; 12 13template<bool b> 14struct always_false { 15 static const bool value = false; 16}; 17 18template<bool b> 19struct and_or { 20 static const bool and_value = b && and_or<always_false<b>::value>::and_value; 21 static const bool or_value = !b || and_or<always_false<b>::value>::or_value; 22}; 23 24static const bool and_value = and_or<true>::and_value; 25static const bool or_value = and_or<true>::or_value; 26