================
@@ -6930,17 +6934,20 @@ ExprResult
Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
IsConvertedConstantExpression = false;
}
- if (getLangOpts().CPlusPlus17) {
+ if (getLangOpts().CPlusPlus17 || PartialOrderingTTP) {
// C++17 [temp.arg.nontype]p1:
// A template-argument for a non-type template parameter shall be
// a converted constant expression of the type of the template-parameter.
APValue Value;
ExprResult ArgResult;
if (IsConvertedConstantExpression) {
- ArgResult = BuildConvertedConstantExpression(Arg, ParamType,
- CCEK_TemplateArg, Param);
- if (ArgResult.isInvalid())
+ ArgResult = BuildConvertedConstantExpression(
+ Arg, ParamType,
+ PartialOrderingTTP ? CCEK_InjectedTTP : CCEK_TemplateArg, Param);
+ if (ArgResult.isInvalid()) {
----------------
mizvekov wrote:
I know it is not representative of this test case not existing, but
uninitialized return is not documented here, and I couldn't find such a case by
inspecting the code.
I would rather assert than guess what should happen here, thanks!
https://github.com/llvm/llvm-project/pull/124313
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits