[PATCH] D148723: [clang] Enforce external linkage for inline builtin original declaration

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 16 15:23:13 PDT 2023


efriedma added a comment.

Is there some reason we actually need to do this whole dance in C++?  The whole point of "inline builtins" was to handle constructs in the glibc headers that involve implementations of libc functions that somehow end up recursively calling themselves instead of a real implementation.  In C++, you can't get away with that sort of thing anyway: the compiler, in general, doesn't discard inline functions, so you can't guarantee that an external implementation will be used.

So if isInlineBuiltinDeclaration() simply returns false for C++ code, everything should just work, without messing with the linkage.


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

https://reviews.llvm.org/D148723



More information about the cfe-commits mailing list