Skip to content

Commit c704000

Browse files
committed
Refactor internal declaration diagnostics in SemaExpr to consolidate Windows and COFF target checks under a single conditional for improved clarity and cross-platform compatibility.
1 parent 280e42b commit c704000

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

clang/lib/Sema/SemaExpr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ static bool hasAnyExplicitStorageClass(const FunctionDecl *D) {
157157
static void diagnoseUseOfInternalDeclInInlineFunction(Sema &S,
158158
const NamedDecl *D,
159159
SourceLocation Loc) {
160-
#ifdef _WIN32
161-
return;
162-
#endif
160+
const llvm::Triple &Triple = S.Context.getTargetInfo().getTriple();
161+
if (Triple.isOSWindows() || Triple.isOSBinFormatCOFF())
162+
return;
163163
// This is disabled under C++; there are too many ways for this to fire in
164164
// contexts where the warning is a false positive, or where it is technically
165165
// correct but benign.

0 commit comments

Comments
 (0)