diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-05-23 01:32:17 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-05-23 01:32:17 +0000 |
| commit | 7800f1f5aa04876e327f6522118bc642c1c43532 (patch) | |
| tree | 6aee211c6ffebfb4296fe47d19e297161f186eed /clang/lib | |
| parent | d5aa33525c349a585a197c55a7dfd69e3ae2d41e (diff) | |
| download | bcm5719-llvm-7800f1f5aa04876e327f6522118bc642c1c43532.tar.gz bcm5719-llvm-7800f1f5aa04876e327f6522118bc642c1c43532.zip | |
[Sema] Don't use dyn_cast to detect an AtomicType
An AtomicType might be hidden behind arbitrary levels of typedefs.
getAs<> will reliably walk through the sugar to get the underlying
AtomicType.
This fixes PR23638.
llvm-svn: 238083
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index a64932b1c71..23a6fc3c4cd 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -6100,7 +6100,7 @@ static void DiagnoseOutOfRangeComparison(Sema &S, BinaryOperator *E, // TODO: Investigate using GetExprRange() to get tighter bounds // on the bit ranges. QualType OtherT = Other->getType(); - if (const AtomicType *AT = dyn_cast<AtomicType>(OtherT)) + if (const auto *AT = OtherT->getAs<AtomicType>()) OtherT = AT->getValueType(); IntRange OtherRange = IntRange::forValueOfType(S.Context, OtherT); unsigned OtherWidth = OtherRange.Width; |

