[PATCH] D104830: AST: Create __va_list in the std namespace even in C.

Jessica Clarke via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 15 11:34:28 PST 2021


jrtc27 added a comment.

This also leaks out to users via __builtin_dump_struct (https://godbolt.org/z/vx3rjdPdq), and of course the DWARF having the namespace in it will result in users debugging plain C seeing C++ namespaces.

ASTDiagnostic's Desugar happens to special-case va_list so it doesn't get desugared from the result of the typedef, and thus the struct std::__va_list doesn't leak out that way.

I also wouldn't be surprised if some consumers of Clang's AST get confused by a namespace appearing for C output; e.g. I could imagine IDEs using clangd displaying very confusing information to users writing C code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104830/new/

https://reviews.llvm.org/D104830



More information about the cfe-commits mailing list