HomePhabricator

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

Authored by shivanshu3 on Oct 6 2020, 7:12 AM.

Description

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

Details

Committed
hansOct 6 2020, 7:23 AM
Differential Revision
D88680: Add ability to turn off -fpch-instantiate-templates in clang-cl
Parents
rGb3876ef49093: Silence -Wunused-variable in NDEBUG mode
Branches
Unknown
Tags
Unknown