summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2012-04-11 16:08:14 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2012-04-11 16:08:14 +0000
commitf6e07b995123637e340280ac19a1841f9bbe9fac (patch)
treefa2be7d6e83c9a072b4cefb26a90b9265721ff8d
parent14ada94682fd7857e81e8dc58a2b37c309879a04 (diff)
downloadbcm5719-llvm-f6e07b995123637e340280ac19a1841f9bbe9fac.tar.gz
bcm5719-llvm-f6e07b995123637e340280ac19a1841f9bbe9fac.zip
Clean up last commit as per dgregor's comments.
llvm-svn: 154501
-rw-r--r--clang/lib/Sema/SemaOverload.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 4ba25c4eeba..40fb01ac30d 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -1316,13 +1316,6 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType,
SCS.setFromType(FromType);
SCS.CopyConstructor = 0;
- // Allow conversion to _Atomic types. These are C11 and are provided as an
- // extension in C++ mode.
- if (const AtomicType *ToAtomicType = ToType->getAs<AtomicType>()) {
- if (ToAtomicType->getValueType() == FromType)
- return true;
- }
-
// There are no standard conversions for class types in C++, so
// abort early. When overloading in C, however, we do permit
if (FromType->isRecordType() || ToType->isRecordType()) {
@@ -1527,6 +1520,13 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType,
SCS, CStyle)) {
SCS.Second = ICK_TransparentUnionConversion;
FromType = ToType;
+ } else if (const AtomicType *ToAtomicType = ToType->getAs<AtomicType>()) {
+ // Allow conversion to _Atomic types. These are C11 and are provided as an
+ // extension in C++ mode.
+ if (S.Context.hasSameUnqualifiedType(ToAtomicType->getValueType(),
+ FromType))
+ SCS.Second = ICK_Identity;
+ FromType = ToType;
} else {
// No second conversion required.
SCS.Second = ICK_Identity;
OpenPOWER on IntegriCloud