summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2012-04-11 15:29:15 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2012-04-11 15:29:15 +0000
commit28397be05985863cf3915aa789e574f63204bb70 (patch)
tree39347ad9222c540d0c958ba1701fae085afca1d7 /clang/lib/Sema
parent2335a5cb853c596ee44bae7fdaf7c2e9f2fd3b44 (diff)
downloadbcm5719-llvm-28397be05985863cf3915aa789e574f63204bb70.tar.gz
bcm5719-llvm-28397be05985863cf3915aa789e574f63204bb70.zip
Allow c++ initialisers to initialise _Atomic fields.
llvm-svn: 154499
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index e4c6fdfb59c..4ba25c4eeba 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -1316,6 +1316,13 @@ 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()) {
OpenPOWER on IntegriCloud