p23.cpp revision 8e8fb3be5bd78f0564444eca02b404566a5f3b5d
1// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
2// expected-no-diagnostics
3
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