From ecb7e5c8afe929ee38155db94de6b084ec32a645 Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Tue, 16 Feb 2010 09:31:36 +0000 Subject: Update clang to r96341. --- test/SemaCXX/explicit.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/SemaCXX/explicit.cpp (limited to 'test/SemaCXX/explicit.cpp') diff --git a/test/SemaCXX/explicit.cpp b/test/SemaCXX/explicit.cpp new file mode 100644 index 0000000000000..717ed1e3caf26 --- /dev/null +++ b/test/SemaCXX/explicit.cpp @@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s +namespace Constructor { +struct A { + A(int); +}; + +struct B { + explicit B(int); +}; + +B::B(int) { } + +struct C { + void f(const A&); + void f(const B&); +}; + +void f(C c) { + c.f(10); +} +} + +namespace Conversion { + struct A { + operator int(); + explicit operator bool(); + }; + + A::operator bool() { return false; } + + struct B { + void f(int); + void f(bool); + }; + + void f(A a, B b) { + b.f(a); + } +} -- cgit v1.3