diff options
Diffstat (limited to 'clang/lib/Sema/SemaCast.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaCast.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp index 2c7611de6b5..fe7667e93b3 100644 --- a/clang/lib/Sema/SemaCast.cpp +++ b/clang/lib/Sema/SemaCast.cpp @@ -1897,6 +1897,11 @@ void CastOperation::CheckCStyleCast() { if (SrcExpr.isInvalid()) return; QualType SrcType = SrcExpr.get()->getType(); + + // You can cast an _Atomic(T) to anything you can cast a T to. + if (const AtomicType *AtomicSrcType = SrcType->getAs<AtomicType>()) + SrcType = AtomicSrcType->getValueType(); + assert(!SrcType->isPlaceholderType()); if (Self.RequireCompleteType(OpRange.getBegin(), DestType, |

