Use simpler interface for getting the pointee type for a node.

llvm-svn: 248449
diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp
index 774ecbb..cb6f7ce 100644
--- a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp
@@ -601,7 +601,7 @@
       // A node will only be bound with DerefByRefResultName if we're dealing
       // with a user-defined iterator type. Test the const qualification of
       // the reference type.
-      auto ValueType = (*DerefType)->getAs<ReferenceType>()->getPointeeType();
+      auto ValueType = DerefType->getNonReferenceType();
 
       Descriptor.DerefByConstRef = ValueType.isConstQualified();
       Descriptor.IsTriviallyCopyable =