Manna created this revision.
Manna added a reviewer: erichkeane.
Herald added a project: All.
Manna requested review of this revision.
Herald added a project: clang.

This patch uses castAs instead of getAs which will assert if the type doesn't 
match in ConvertQualTypeToKind(clang::​ASTContext const &, clang::​QualType).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151928

Files:
  clang/lib/Interpreter/Value.cpp


Index: clang/lib/Interpreter/Value.cpp
===================================================================
--- clang/lib/Interpreter/Value.cpp
+++ clang/lib/Interpreter/Value.cpp
@@ -108,7 +108,7 @@
   if (!BT || BT->isNullPtrType())
     return Value::K_PtrOrObj;
 
-  switch (QT->getAs<BuiltinType>()->getKind()) {
+  switch (QT->castAs<BuiltinType>()->getKind()) {
   default:
     assert(false && "Type not supported");
     return Value::K_Unspecified;


Index: clang/lib/Interpreter/Value.cpp
===================================================================
--- clang/lib/Interpreter/Value.cpp
+++ clang/lib/Interpreter/Value.cpp
@@ -108,7 +108,7 @@
   if (!BT || BT->isNullPtrType())
     return Value::K_PtrOrObj;
 
-  switch (QT->getAs<BuiltinType>()->getKind()) {
+  switch (QT->castAs<BuiltinType>()->getKind()) {
   default:
     assert(false && "Type not supported");
     return Value::K_Unspecified;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to