[all-commits] [llvm/llvm-project] 366ffb: [C++20] [Modules] [Driver] Don't enable -fdelayed-...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Sun Oct 22 19:06:30 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 366ffbaf627d0b6867299458cf57f8464259e550
      https://github.com/llvm/llvm-project/commit/366ffbaf627d0b6867299458cf57f8464259e550
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2023-10-23 (Mon, 23 Oct 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/Driver/cl-delayed-template-parsing-cxx20.cpp

  Log Message:
  -----------
  [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 (#69431)

There are already 3 issues about the broken state of
-fdelayed-template-parsing and C++20 modules:
- https://github.com/llvm/llvm-project/issues/61068
- https://github.com/llvm/llvm-project/issues/64810
- https://github.com/llvm/llvm-project/issues/65027

The problem is more complex than I thought. I am not sure how to fix it
properly now. Given the complexities and -fdelayed-template-parsing is
actually an extension to support old MS codes, I think it may make sense
to not enable the -fdelayed-template-parsing option by default with
C++20 modules to give more user friendly experience. Users who still
want -fdelayed-template-parsing can specify it explicitly.

Also according to https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170, MSVC actually defaults to -fno-delayed-template-parsing (/Zc:twoPhase-
with MSVC CLI) if using C++20. So we match the behavior with MSVC here to
not enable -fdelayed-template-parsing by default after C++20.




More information about the All-commits mailing list