Allow explicit ctors for casts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80374 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp
index 9c27bf6..52ebdef 100644
--- a/lib/Sema/SemaCXXCast.cpp
+++ b/lib/Sema/SemaCXXCast.cpp
@@ -784,7 +784,7 @@
ImplicitConversionSequence ICS =
Self.TryImplicitConversion(SrcExpr, DestType,
/*SuppressUserConversions=*/false,
- /*AllowExplicit=*/false,
+ /*AllowExplicit=*/true,
/*ForceRValue=*/false,
/*InOverloadResolution=*/false);
diff --git a/test/SemaCXX/cast-explicit-ctor.cpp b/test/SemaCXX/cast-explicit-ctor.cpp
new file mode 100644
index 0000000..1064758
--- /dev/null
+++ b/test/SemaCXX/cast-explicit-ctor.cpp
@@ -0,0 +1,6 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+struct B { B(bool); };
+void f() {
+ (void)(B)true;
+ (void)B(true);
+}