Include pointee type information in the diagnostic for creating bad pointers or
arrays.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85550 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index c135f43..d2652c9 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -472,7 +472,7 @@
if (T->isReferenceType()) {
// C++ 8.3.2p4: There shall be no ... pointers to references ...
Diag(Loc, diag::err_illegal_decl_pointer_to_reference)
- << getPrintableNameForEntity(Entity);
+ << getPrintableNameForEntity(Entity) << T;
return QualType();
}
@@ -600,14 +600,14 @@
if (T->isFunctionType()) {
Diag(Loc, diag::err_illegal_decl_array_of_functions)
- << getPrintableNameForEntity(Entity);
+ << getPrintableNameForEntity(Entity) << T;
return QualType();
}
// C++ 8.3.2p4: There shall be no ... arrays of references ...
if (T->isReferenceType()) {
Diag(Loc, diag::err_illegal_decl_array_of_references)
- << getPrintableNameForEntity(Entity);
+ << getPrintableNameForEntity(Entity) << T;
return QualType();
}
@@ -811,7 +811,7 @@
// with reference type, or "cv void."
if (T->isReferenceType()) {
Diag(Loc, diag::err_illegal_decl_mempointer_to_reference)
- << (Entity? Entity.getAsString() : "type name");
+ << (Entity? Entity.getAsString() : "type name") << T;
return QualType();
}