diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-09-19 22:00:16 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-09-19 22:00:16 +0000 |
commit | 40c3d6e33590054f095b5adfcd62ddc3c5c58e69 (patch) | |
tree | 70ce8f1a7f9fed279bbefcf340c2cd32181c8b45 /clang/lib/Sema/SemaTemplate.cpp | |
parent | 0c3d4cfbadef74e7019ac6fc950a0c7034db79bf (diff) | |
download | bcm5719-llvm-40c3d6e33590054f095b5adfcd62ddc3c5c58e69.tar.gz bcm5719-llvm-40c3d6e33590054f095b5adfcd62ddc3c5c58e69.zip |
Model converted constant expressions as full-expressions.
This is groundwork for C++20's P0784R7, where non-trivial destructors
can be constexpr, so we need ExprWithCleanups markers in constant
expressions.
No functionality change intended.
llvm-svn: 372359
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 91466fa904b..5633582d679 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -6431,8 +6431,11 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, } // If either the parameter has a dependent type or the argument is - // type-dependent, there's nothing we can check now. - if (ParamType->isDependentType() || Arg->isTypeDependent()) { + // type-dependent, there's nothing we can check now. The argument only + // contains an unexpanded pack during partial ordering, and there's + // nothing more we can check in that case. + if (ParamType->isDependentType() || Arg->isTypeDependent() || + Arg->containsUnexpandedParameterPack()) { // Force the argument to the type of the parameter to maintain invariants. auto *PE = dyn_cast<PackExpansionExpr>(Arg); if (PE) |