[all-commits] [llvm/llvm-project] 59553f: [clang] avoid reentering header-name lexing on nes...

Oleksandr Tarasiuk via All-commits all-commits at lists.llvm.org
Fri Feb 13 08:59:11 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 59553fa27a52fd95d9f5386a4554e76f3a8e5c9a
      https://github.com/llvm/llvm-project/commit/59553fa27a52fd95d9f5386a4554e76f3a8e5c9a
  Author: Oleksandr Tarasiuk <oleksandr.tarasiuk at outlook.com>
  Date:   2026-02-13 (Fri, 13 Feb 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Lex/Preprocessor.cpp
    M clang/test/Preprocessor/embed___has_embed_parsing_errors.c
    M clang/test/Preprocessor/has_include.c

  Log Message:
  -----------
  [clang] avoid reentering header-name lexing on nested macro expansion (#179151)

Fixes #178635

---

This PR addressed the issue when header-name _lexing_ reentered on
nested macro expansion.

`__has_include`/`__has_embed` lex a header name by calling
`LexHeaderName`, and neither expects nested expansion in that context.

If `__has_include` appears inside the header name expression (e.g.,
`__has_include(__has_include)`, or `__has_embed(__has_include)`)


https://github.com/llvm/llvm-project/blob/6a18039298174562a38f28ca06d12dcbf7f14f06/clang/lib/Lex/PPMacroExpansion.cpp#L1252

macro expansion reenters `LexHeaderName` and hits the assertion


https://github.com/llvm/llvm-project/blob/6a18039298174562a38f28ca06d12dcbf7f14f06/clang/lib/Lex/PPMacroExpansion.cpp#L1898


https://github.com/llvm/llvm-project/blob/6a18039298174562a38f28ca06d12dcbf7f14f06/clang/lib/Lex/PPMacroExpansion.cpp#L1156



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list