Home | History | Annotate | Download | only in over.built
      1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
      2 
      3 struct Variant {
      4   template <typename T> operator T();
      5 };
      6 
      7 Variant getValue();
      8 
      9 void testVariant() {
     10   bool ret1 = getValue() || getValue();
     11   bool ret2 = getValue() && getValue();
     12   bool ret3 = !getValue();
     13 }
     14 
     15 struct ExplicitVariant {
     16   template <typename T> explicit operator T();
     17 };
     18 
     19 ExplicitVariant getExplicitValue();
     20 
     21 void testExplicitVariant() {
     22   bool ret1 = getExplicitValue() || getExplicitValue();
     23   bool ret2 = getExplicitValue() && getExplicitValue();
     24   bool ret3 = !getExplicitValue();
     25 }
     26