1 // PR c++/87145
2 // { dg-do compile { target c++11 } }
3 
4 template<typename T, T t> struct integral_constant {
5   static constexpr T value = t;
6 };
7 
8 enum class Enum : unsigned {};
9 
10 struct Pod {
11   unsigned val;
12 
EnumPod13   constexpr operator Enum() const {
14     return static_cast<Enum>(val);
15   }
16 };
17 
18 template<unsigned N>
foo()19 constexpr void foo() {
20   using Foo = integral_constant<Enum, Pod{N}>;
21 }
22 
main()23 int main() {
24   foo<2>();
25 }
26