llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

-Wreserved-macro-identifier does not catch command line macros

Open AaronBallman opened this issue 4 years ago • 5 comments

If you define or undefine a reserved macro name within the TU, we properly diagnose it. But if you define or undefine a macro using the command line, we do not issue any diagnostics. I think the command line should be treated the same as within a TU.

Live example: https://godbolt.org/z/3edqooWr9

AaronBallman avatar Jun 22 '22 10:06 AaronBallman

@llvm/issue-subscribers-good-first-issue

llvmbot avatar Jun 22 '22 10:06 llvmbot

@llvm/issue-subscribers-clang-frontend

llvmbot avatar Jun 22 '22 10:06 llvmbot

Hi, @AaronBallman. I hope to fix this issue.

jackhong12 avatar Jul 02 '22 18:07 jackhong12

Revision: https://reviews.llvm.org/D129061

jackhong12 avatar Jul 04 '22 07:07 jackhong12

Appears to be fixed in Clang 17: https://godbolt.org/z/fKv36rbMP

Endilll avatar Jan 20 '24 13:01 Endilll