Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.
llvm-svn: 123814
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 4d67ff2..a37a973 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -827,7 +827,7 @@
// Create Decl objects for each parameter, adding them to the
// FunctionDecl.
- if (FunctionProtoType *FT = dyn_cast<FunctionProtoType>(R)) {
+ if (const FunctionProtoType *FT = dyn_cast<FunctionProtoType>(R)) {
llvm::SmallVector<ParmVarDecl*, 16> Params;
for (unsigned i = 0, e = FT->getNumArgs(); i != e; ++i)
Params.push_back(ParmVarDecl::Create(Context, New, SourceLocation(), 0,
@@ -6143,7 +6143,8 @@
} else {
// If the type is currently being defined, complain
// about a nested redefinition.
- TagType *Tag = cast<TagType>(Context.getTagDeclType(PrevTagDecl));
+ const TagType *Tag
+ = cast<TagType>(Context.getTagDeclType(PrevTagDecl));
if (Tag->isBeingDefined()) {
Diag(NameLoc, diag::err_nested_redefinition) << Name;
Diag(PrevTagDecl->getLocation(),
@@ -7108,7 +7109,7 @@
FieldDecl *FD = cast<FieldDecl>(Fields[i]);
// Get the type for the field.
- Type *FDTy = FD->getType().getTypePtr();
+ const Type *FDTy = FD->getType().getTypePtr();
if (!FD->isAnonymousStructOrUnion()) {
// Remember all fields written by the user.