diff options
author | Artem Dergachev <adergachev@apple.com> | 2023-06-13 13:39:45 -0700 |
---|---|---|
committer | Artem Dergachev <adergachev@apple.com> | 2023-06-13 14:36:51 -0700 |
commit | bb209ce138e71f2fd646b7f0f865f957336c67e9 (patch) | |
tree | 5db3ec8715744b427e01650ba1946494aae56246 /clang/lib/Sema/SemaChecking.cpp | |
parent | f1017389103b99f20ddb1cb6da0e5faa8a43c43b (diff) | |
download | llvm-bb209ce138e71f2fd646b7f0f865f957336c67e9.zip llvm-bb209ce138e71f2fd646b7f0f865f957336c67e9.tar.gz llvm-bb209ce138e71f2fd646b7f0f865f957336c67e9.tar.bz2 |
[-Wtcb-enforcement] Disable on unevaluated code.
It doesn't make sense for this warning to warn about things
that don't impact runtime behavior.
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index d5c0463..96f8d49 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -18536,6 +18536,10 @@ bool Sema::BuiltinWasmTableCopy(CallExpr *TheCall) { /// and enforce_tcb_leaf attributes. void Sema::CheckTCBEnforcement(const SourceLocation CallExprLoc, const NamedDecl *Callee) { + // This warning does not make sense in code that has no runtime behavior. + if (isUnevaluatedContext()) + return; + const NamedDecl *Caller = getCurFunctionOrMethodDecl(); if (!Caller || !Caller->hasAttr<EnforceTCBAttr>()) |