summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/pr69091.C
blob: ec7bb25691246382b9a51c17da405e56206de2b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// PR c++/69091
// { dg-do compile { target c++14 } }

template <class ValueType, ValueType>
struct Option {};

template <class ValueType, ValueType Value, class OptionsRhs>
auto operator|(Option<ValueType, Value>, OptionsRhs) {
  return Value;
}

enum canine_t { no, yes };
Option<canine_t, no> cat;
Option<canine_t, yes> dog;

template <class T>
void f(T) {
  cat | dog;
}

struct A {};
int main() {
  f(A{});
  return 0;
}