aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaCXXCast.cpp2
-rw-r--r--test/SemaCXX/cast-explicit-ctor.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp
index 9c27bf6e36..52ebdef6f1 100644
--- a/lib/Sema/SemaCXXCast.cpp
+++ b/lib/Sema/SemaCXXCast.cpp
@@ -784,7 +784,7 @@ TryStaticImplicitCast(Sema &Self, Expr *SrcExpr, QualType DestType,
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 0000000000..1064758635
--- /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);
+}