[clang] 63b6c38 - [clang] Fix incorrect partial ordering context setting (#108491)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 16 05:56:20 PDT 2024
Author: Matheus Izvekov
Date: 2024-09-16T09:56:16-03:00
New Revision: 63b6c384468784d247401098c6200deb9ab70ba0
URL: https://github.com/llvm/llvm-project/commit/63b6c384468784d247401098c6200deb9ab70ba0
DIFF: https://github.com/llvm/llvm-project/commit/63b6c384468784d247401098c6200deb9ab70ba0.diff
LOG: [clang] Fix incorrect partial ordering context setting (#108491)
Added:
Modified:
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/test/SemaTemplate/cwg2398.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index 562c57a41299a9..b50648d5752ce5 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -3411,7 +3411,7 @@ DeduceTemplateArguments(Sema &S, T *Partial,
if (TemplateDeductionResult Result = ::DeduceTemplateArguments(
S, Partial->getTemplateParameters(),
Partial->getTemplateArgs().asArray(), TemplateArgs, Info, Deduced,
- /*NumberOfArgumentsMustMatch=*/false, /*PartialOrdering=*/true,
+ /*NumberOfArgumentsMustMatch=*/false, /*PartialOrdering=*/false,
PackFold::ParameterToArgument,
/*HasDeducedAnyParam=*/nullptr);
Result != TemplateDeductionResult::Success)
diff --git a/clang/test/SemaTemplate/cwg2398.cpp b/clang/test/SemaTemplate/cwg2398.cpp
index 1d9747276fbe00..6dc7af6ea17899 100644
--- a/clang/test/SemaTemplate/cwg2398.cpp
+++ b/clang/test/SemaTemplate/cwg2398.cpp
@@ -379,3 +379,13 @@ namespace regression1 {
bar(input);
}
} // namespace regression1
+
+namespace regression2 {
+ template <class> struct D {};
+
+ template <class ET, template <class> class VT>
+ struct D<VT<ET>>;
+
+ template <typename, int> struct Matrix;
+ template struct D<Matrix<double, 3>>;
+} // namespace regression2
More information about the cfe-commits
mailing list