[all-commits] [llvm/llvm-project] e84852: Add ability to turn off -fpch-instantiate-template...

Shivanshu Goyal via All-commits all-commits at lists.llvm.org
Wed Oct 7 03:09:01 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: e84852be644d34867a604997fd328bf411b1977d
      https://github.com/llvm/llvm-project/commit/e84852be644d34867a604997fd328bf411b1977d
  Author: Shivanshu Goyal <Shivanshu.Goyal at microsoft.com>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/Driver/pch-instantiate-templates.c

  Log Message:
  -----------
  Add ability to turn off -fpch-instantiate-templates in clang-cl

A lot of our code building with clang-cl.exe using Clang 11 was failing with
the following 2 type of errors:

1. explicit specialization of 'foo' after instantiation
2. no matching function for call to 'bar'

Note that we also use -fdelayed-template-parsing in our builds.

I tried pretty hard to get a small repro for these failures, but couldn't. So
there is some subtle edge case in the -fpch-instantiate-templates feature
introduced by this change: https://reviews.llvm.org/D69585

When I tried turning this off using -fno-pch-instantiate-templates, builds
would silently fail with the same error without any indication that
-fno-pch-instantiate-templates was being ignored by the compiler. Then I
realized this "no" option wasn't actually working when I ran Clang under a
debugger.

Differential revision: https://reviews.llvm.org/D88680

(cherry picked from commit 66e4f07198761bbb4dcd55235024c1081ed15c75)




More information about the All-commits mailing list