summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-21 23:15:18 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-21 23:15:18 +0000
commite637cbe4e40ef892c378801d95993be39193bb7e (patch)
tree96c64300984bc9620fc39b25a9a868b427866456 /clang/lib/Sema/SemaTemplate.cpp
parenta49496fb2a16b729f6f6ec8b9a1e8c72133ac9d9 (diff)
downloadbcm5719-llvm-e637cbe4e40ef892c378801d95993be39193bb7e.tar.gz
bcm5719-llvm-e637cbe4e40ef892c378801d95993be39193bb7e.zip
Refactor: split Uninitialized state on APValue into an "Absent" state
representing no such object, and an "Indeterminate" state representing an uninitialized object. The latter is not yet used, but soon will be. llvm-svn: 361328
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 239b4ae7957..2483a28b252 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -6390,10 +6390,13 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
// Convert the APValue to a TemplateArgument.
switch (Value.getKind()) {
- case APValue::Uninitialized:
+ case APValue::None:
assert(ParamType->isNullPtrType());
Converted = TemplateArgument(CanonParamType, /*isNullPtr*/true);
break;
+ case APValue::Indeterminate:
+ llvm_unreachable("result of constant evaluation should be initialized");
+ break;
case APValue::Int:
assert(ParamType->isIntegralOrEnumerationType());
Converted = TemplateArgument(Context, Value.getInt(), CanonParamType);
OpenPOWER on IntegriCloud