[clang] Fix NDEBUG Wundef warning; NFC (PR #170153)

Sven van Haastregt via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 1 07:40:15 PST 2025


https://github.com/svenvh created https://github.com/llvm/llvm-project/pull/170153

The `NDEBUG` macro is tested for defined-ness everywhere else. The instance here triggers a warning when compiling with `-Wundef`.

>From 303ccf0807bda737de76ec6430f6783c14dfeab8 Mon Sep 17 00:00:00 2001
From: Sven van Haastregt <sven.vanhaastregt at arm.com>
Date: Mon, 1 Dec 2025 13:55:44 +0000
Subject: [PATCH] Fix NDEBUG Wundef warning; NFC

The `NDEBUG` macro is tested for defined-ness everywhere else. The
instance here triggers a warning when compiling with `-Wundef`.
---
 clang/include/clang/Basic/TokenKinds.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/include/clang/Basic/TokenKinds.h b/clang/include/clang/Basic/TokenKinds.h
index d84f3598cbf33..a801113c57715 100644
--- a/clang/include/clang/Basic/TokenKinds.h
+++ b/clang/include/clang/Basic/TokenKinds.h
@@ -98,7 +98,7 @@ inline bool isLiteral(TokenKind K) {
   const bool isInLiteralRange =
       K >= tok::numeric_constant && K <= tok::utf32_string_literal;
 
-#if !NDEBUG
+#ifndef NDEBUG
   const bool isLiteralExplicit =
       K == tok::numeric_constant || K == tok::char_constant ||
       K == tok::wide_char_constant || K == tok::utf8_char_constant ||



More information about the cfe-commits mailing list