brintos

brintos / llvm-project-archived public Read only

0
0
Text · 589 B · a1c0d4f Raw
27 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s2// expected-no-diagnostics3 4struct Variant {5  template <typename T> operator T();6};7 8Variant getValue();9 10void testVariant() {11  bool ret1 = getValue() || getValue(); 12  bool ret2 = getValue() && getValue(); 13  bool ret3 = !getValue();14}15 16struct ExplicitVariant {17  template <typename T> explicit operator T();18};19 20ExplicitVariant getExplicitValue();21 22void testExplicitVariant() {23  bool ret1 = getExplicitValue() || getExplicitValue(); 24  bool ret2 = getExplicitValue() && getExplicitValue(); 25  bool ret3 = !getExplicitValue();26}27