blob: 1b38cf19b42e3d206d3d46c07044dbd27e2ff6cb [file] [log] [blame]
Douglas Gregorfcafc6e2011-05-24 16:02:01 +00001// 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;