[PATCH] D92409: [AST][NFC] Silence GCC warning about multiline comments

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 12 23:56:23 PST 2020


rsmith added a comment.

In D92409#2450550 <https://reviews.llvm.org/D92409#2450550>, @thopre wrote:

> In D92409#2426196 <https://reviews.llvm.org/D92409#2426196>, @thopre wrote:
>
>> Is there a way to disable it from the header? I've noticed this warning when compiling an application using libclang with g++. So I'm looking for a fix outside clang's build system which is not used in that case.
>
> Ping?

`#pragma GCC diagnostic ignored` (https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html) can do it. Now, we can't reasonably guarantee that Clang headers won't cause arbitrary broken warnings to fire, so there's a judgment call here on the extent to which we should carry changes to support use of such warning flags (versus expecting the code including the header to disable the warning). In this case, it's probably worth it, though, because the warning in question is part of GCC's `-Wall`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92409



More information about the cfe-commits mailing list