aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaDeclCXX.cpp2
-rw-r--r--lib/Sema/SemaExprCXX.cpp3
-rw-r--r--lib/Sema/SemaInit.h2
-rw-r--r--test/SemaCXX/new-delete.cpp4
4 files changed, 6 insertions, 5 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 9e30af8f18..ded89b453c 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -4707,7 +4707,7 @@ CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
<< FnDecl->getDeclName() << ExpectedFirstParamType;
// Check that the first parameter type is what we expect.
- if (SemaRef.Context.getCanonicalType(FirstParamType) !=
+ if (SemaRef.Context.getCanonicalType(FirstParamType).getUnqualifiedType() !=
ExpectedFirstParamType)
return SemaRef.Diag(FnDecl->getLocation(), InvalidParamTypeDiag)
<< FnDecl->getDeclName() << ExpectedFirstParamType;
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index dd3d2ea2ce..45ee4fd64e 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -737,7 +737,8 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
// FIXME: Do we need to check for default arguments here?
FunctionDecl *Func = cast<FunctionDecl>(*Alloc);
if (Func->getNumParams() == 1 &&
- Context.getCanonicalType(Func->getParamDecl(0)->getType())==Argument)
+ Context.getCanonicalType(
+ Func->getParamDecl(0)->getType().getUnqualifiedType()) == Argument)
return;
}
}
diff --git a/lib/Sema/SemaInit.h b/lib/Sema/SemaInit.h
index 959c55e3d3..5eb819a691 100644
--- a/lib/Sema/SemaInit.h
+++ b/lib/Sema/SemaInit.h
@@ -102,7 +102,7 @@ private:
/// \brief Create the initialization entity for a parameter.
InitializedEntity(ParmVarDecl *Parm)
- : Kind(EK_Parameter), Parent(0), Type(Parm->getType()),
+ : Kind(EK_Parameter), Parent(0), Type(Parm->getType().getUnqualifiedType()),
VariableOrMember(reinterpret_cast<DeclaratorDecl*>(Parm)) { }
/// \brief Create the initialization entity for the result of a
diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp
index 91f800daea..0e0f630bc4 100644
--- a/test/SemaCXX/new-delete.cpp
+++ b/test/SemaCXX/new-delete.cpp
@@ -18,7 +18,8 @@ struct V : U
{
};
-void* operator new(size_t); // expected-note 2 {{candidate}}
+// PR5823
+void* operator new(const size_t); // expected-note 2 {{candidate}}
void* operator new(size_t, int*); // expected-note 3 {{candidate}}
void* operator new(size_t, float*); // expected-note 3 {{candidate}}
void* operator new(size_t, S); // expected-note 2 {{candidate}}
@@ -215,4 +216,3 @@ static void* f(void* g)
{
return new (g) X13();
}
-