aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-08-05 02:49:48 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-08-05 02:49:48 +0000
commit1357869bc5983cdfbc986db1f3d18265bb34cb0e (patch)
treed5241a4058c97650ff4053d69296f8a997698c94 /lib/Sema/SemaTemplate.cpp
parent7f584bbe9c2de8455bfb572d4ab571628c6c024e (diff)
Get rid of isObjectType; when C++ says "object type", it generally
just means "not a function type", not "not a function type or void". This changes behavior slightly, but generally in a way which accepts more code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index d6672df3f4..175ddf639c 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -542,9 +542,7 @@ Sema::CheckNonTypeTemplateParameterType(QualType T, SourceLocation Loc) {
// -- integral or enumeration type,
if (T->isIntegralOrEnumerationType() ||
// -- pointer to object or pointer to function,
- (T->isPointerType() &&
- (T->getAs<PointerType>()->getPointeeType()->isObjectType() ||
- T->getAs<PointerType>()->getPointeeType()->isFunctionType())) ||
+ T->isPointerType() ||
// -- reference to object or reference to function,
T->isReferenceType() ||
// -- pointer to member.
@@ -2923,7 +2921,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
// object, qualification conversions (4.4) and the
// array-to-pointer conversion (4.2) are applied.
// C++0x also allows a value of std::nullptr_t.
- assert(ParamType->getAs<PointerType>()->getPointeeType()->isObjectType() &&
+ assert(ParamType->getPointeeType()->isIncompleteOrObjectType() &&
"Only object pointers allowed here");
return CheckTemplateArgumentAddressOfObjectOrFunction(*this, Param,
@@ -2938,7 +2936,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
// identical) type of the template-argument. The
// template-parameter is bound directly to the
// template-argument, which must be an lvalue.
- assert(ParamRefType->getPointeeType()->isObjectType() &&
+ assert(ParamRefType->getPointeeType()->isIncompleteOrObjectType() &&
"Only object references allowed here");
if (Arg->getType() == Context.OverloadTy) {