view gcc/testsuite/g++.dg/template/pr69091.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// 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;
}