[PATCH] D67414: [AST] Treat "inline gnu_inline" the same way as "extern inline gnu_inline" in C++ mode

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 00:37:04 PDT 2019


mstorsjo added a comment.

In D67414#1668579 <https://reviews.llvm.org/D67414#1668579>, @rsmith wrote:

> OK. If this is causing compatibility pain in practice, following GCC here seems reasonable. We should at least produce a warning on `gnu_inline` without `extern` in C++ mode, though.


Yes, a warning probably is good. As these things tend to be in headers, it'd be quite spammy, but it would alert the user that while the construct does work in current (future) clang versions, it doesn't in older ones, allowing users to steer clear of it.

Is there any existing DiagGroup which would be a good fit for such a warning, and what would be good wording for it?

"gnu_inline without extern in C++ treated as if externally available" (which is exactly what the GCC docs for the attribute says, which isn't too understandable unless you know the history)

"gnu_inline without extern in C++ changed behaviour in Clang 10" (doesn't say much about what changed and how)


Repository:
  rC Clang

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

https://reviews.llvm.org/D67414





More information about the cfe-commits mailing list