diff options
author | David Chisnall <csdavec@swan.ac.uk> | 2012-04-11 15:29:15 +0000 |
---|---|---|
committer | David Chisnall <csdavec@swan.ac.uk> | 2012-04-11 15:29:15 +0000 |
commit | 3a3c9b26ded46cb9055564adb2f48911eef84ace (patch) | |
tree | 58de576d39c82684136e9b9fac49cc97a776c870 /lib | |
parent | 93848e08a512a9487485dc4a94d03a66529be703 (diff) |
Allow c++ initialisers to initialise _Atomic fields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index e4c6fdfb59..4ba25c4eeb 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/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()) { |