aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-26 19:13:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-26 19:13:44 +0000
commitbb71001d287fda144c4bcf096124d8e3667d6930 (patch)
treeeb578415d3fd6b4639cf4547bed95ca89c2e00f1 /lib/Sema/SemaType.cpp
parent22dc0b04351f5d3feeb6e121f330fb8ae18090e3 (diff)
Drop uses of getAsPointerLikeType.
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index f8b277ae78..47cf8e5611 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -201,8 +201,10 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS) {
// or incomplete types shall not be restrict-qualified." C++ also allows
// restrict-qualified references.
if (TypeQuals & QualType::Restrict) {
- if (const PointerLikeType *PT = Result->getAsPointerLikeType()) {
- QualType EltTy = PT->getPointeeType();
+ if (Result->isPointerType() || Result->isReferenceType()) {
+ QualType EltTy = Result->isPointerType() ?
+ Result->getAsPointerType()->getPointeeType() :
+ Result->getAsReferenceType()->getPointeeType();
// If we have a pointer or reference, the pointee must have an object or
// incomplete type.