[PATCH] D116925: [clangd] Suppress warning about system_header pragma when editing headers

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 13 03:46:01 PST 2022


sammccall added a comment.

In D116925#3231110 <https://reviews.llvm.org/D116925#3231110>, @hokein wrote:

> In D116925#3230991 <https://reviews.llvm.org/D116925#3230991>, @sammccall wrote:
>
>> I wasn't sure whether to suppress this in clang or clangd, wonder what you think.
>
> I think it is fine to do it in clang. `pp_pragma_once_in_main_file` is a similar diag, and clang has already suppressed it.

As discussed offline, if we drop the warning in clang it's not clear whether we can/should keep ignoring the pragma.
Probably the principled answer is we should respect the pragma, but the implications of the extra FileChanged call aren't clear to me.

Simply suppressing the warning in clang (but continuing to ignore the pragma) seems no more principled than this patch.
Until we work it out, I think we should just suppress here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116925



More information about the cfe-commits mailing list