summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-10-11 17:59:09 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-10-11 17:59:09 +0000
commit58fa5962e26bc074c9ba76ed3c066ba59d2f2c67 (patch)
treebd87deb95ad2100c9f8d66223e27791399e9715e /lib
parent2adffce40113c28d43ce3eac7bc64fdef0bf1e4b (diff)
downloadclang-58fa5962e26bc074c9ba76ed3c066ba59d2f2c67.tar.gz
Suppress false-positive -Wdeprecated-volatile warning from __is_*_assignable(volatile T&, U).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExprCXX.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 68fe52993a..a7d8c5009b 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -5243,7 +5243,13 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, QualType LhsT,
Sema::ContextRAII TUContext(Self, Self.Context.getTranslationUnitDecl());
ExprResult Result = Self.BuildBinOp(/*S=*/nullptr, KeyLoc, BO_Assign, &Lhs,
&Rhs);
- if (Result.isInvalid() || SFINAE.hasErrorOccurred())
+ if (Result.isInvalid())
+ return false;
+
+ // Treat the assignment as unused for the purpose of -Wdeprecated-volatile.
+ Self.CheckUnusedVolatileAssignment(Result.get());
+
+ if (SFINAE.hasErrorOccurred())
return false;
if (BTT == BTT_IsAssignable)