mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 06:26:10 +00:00

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.
11 lines
463 B
C++
11 lines
463 B
C++
// RUN: %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=PRE-CXX20
|
|
// RUN: %clang_cl -std:c++20 -### -- %s 2>&1 | FileCheck %s
|
|
// RUN: %clang_cl -std:c++20 -### -fdelayed-template-parsing -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-EXPLICIT
|
|
|
|
// PRE-CXX20: -fdelayed-template-parsing
|
|
|
|
// CHECK-NOT: -fdelayed-template-parsing
|
|
|
|
// CHECK-EXPLICIT: warning: -fdelayed-template-parsing is deprecated after C++20
|
|
// CHECK-EXPLICIT: -fdelayed-template-parsing
|