[all-commits] [llvm/llvm-project] c286d6: [Parser] Suppress -Wempty-translation-unit if this...

Sam McCall via All-commits all-commits at lists.llvm.org
Thu Aug 13 00:44:19 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c286d6fdeeb2b103777d3ae8c9de84937cb51efe
      https://github.com/llvm/llvm-project/commit/c286d6fdeeb2b103777d3ae8c9de84937cb51efe
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M clang/lib/Parse/Parser.cpp
    M clang/test/Parser/empty-translation-unit.c

  Log Message:
  -----------
  [Parser] Suppress -Wempty-translation-unit if this is a header file

This is motivated by tooling (clangd, libclang etc) - headers without
declarations are legitimate even if they're not valid TUs.

The other use -x c-header cases (PCH/modules) are nonstandard anyway and this
warning doesn't seem necessary there either.

Differential Revision: https://reviews.llvm.org/D85789




More information about the All-commits mailing list