[clang] [Clang][Lex] Implement CWG3013: Error if #embed parameters were defined as macros (PR #224769)
Ian Li via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 21 22:12:40 PDT 2026
================
@@ -3771,6 +3771,10 @@ void Preprocessor::HandleElifFamilyDirective(Token &ElifToken,
std::optional<LexEmbedParametersResult>
Preprocessor::LexEmbedParameters(Token &CurTok, bool ForHasEmbed) {
LexEmbedParametersResult Result{};
+ if (ForHasEmbed)
+ assert(isParsingIfOrElifDirective() &&
+ "__has_embed outside of #if or #elif directive?");
----------------
ianayl wrote:
That does seem cleaner, thanks btw!
https://github.com/llvm/llvm-project/pull/224769
More information about the cfe-commits
mailing list