////// Variants for bug 145294

//! \file bug1.cc

/*
  Class templates Enable_If and Has_Property are only needed to compile
  the example using g++. They are not actually needed to show the bug.
*/
template <bool b, typename T = void>
struct Enable_If {};

template <typename T>
struct Enable_If<true, T> {
  typedef T type;
};

template <typename T, typename Enable = void>
struct Has_Property {
  enum {
    value = true
  };
};

template <bool b1, bool b2>
class Bug1 {
public:
  // Boolean expressions having no parentheses do NOT trigger the bug.
  typename Enable_If<b1>::type ok1();
  typename Enable_If<!b1>::type ok2();
  typename Enable_If<b1 && b2>::type ok3();
  typename Enable_If<b1 || b2>::type ok4();
  typename Enable_If<!b1 || b2>::type ok5();

  // Balanced angled parentheses do NOT trigger the bug.
  typename Enable_If<Has_Property<bool>::value>::type ok6();

  // Balanced (round) parentheses DO trigger a doxygen bug,
  // causing a spurious warning.
  typename Enable_If<(b1)>::type ko1();

  // Unbalanced angled parentheses trigger bug 145294.
  typename Enable_If< (b1 < b2) >::type ko2();

};
