[clang] Restrict Inline Builtin to non-static, non-odr linkage
authorserge-sans-paille <sguelton@mozilla.com>
Wed, 19 Apr 2023 14:15:17 +0000 (16:15 +0200)
committerserge-sans-paille <sguelton@mozilla.com>
Mon, 29 May 2023 08:02:18 +0000 (10:02 +0200)
commite20931b2ccd10de2fd25d9a6fbe9c166e7430f23
tree168dcce6482904dfba6c3f479825aca5df2bf364
parent752f9d02cc3ea56dd94c4eac0eeebafb388ae4e7
[clang] Restrict Inline Builtin to non-static, non-odr linkage

Inline builtins have a very special behavior compared to other
functions, it's better if we keep them restricted to a minimal set of
functions.

Add a linkage check which prevents considering ODR definitions as inline
builtins.

Fix #62958

Differential Revision: https://reviews.llvm.org/D148723
clang/lib/AST/Decl.cpp
clang/test/CodeGen/inline-builtin-comdat.c [new file with mode: 0644]