forked from OSchip/llvm-project
Make CXXBaseSpecifier::getType return unqual type.
Various pieces of code, like base initialization in Sema and RTTI IRGen, don't properly ignore qualifiers on base classes. Instead of auditing the whole codebase, just strip them off in the getter. (The type as written is still available in the TypeSourceInfo for code that cares.) Fixes PR16596. llvm-svn: 186125
This commit is contained in:
parent
7df860a629
commit
a0e6a7fcd8
|
@ -250,7 +250,9 @@ public:
|
|||
/// \brief Retrieves the type of the base class.
|
||||
///
|
||||
/// This type will always be an unqualified class type.
|
||||
QualType getType() const { return BaseTypeInfo->getType(); }
|
||||
QualType getType() const {
|
||||
return BaseTypeInfo->getType().getUnqualifiedType();
|
||||
}
|
||||
|
||||
/// \brief Retrieves the type and source location of the base class.
|
||||
TypeSourceInfo *getTypeSourceInfo() const { return BaseTypeInfo; }
|
||||
|
|
|
@ -98,3 +98,13 @@ namespace rdar13185264 {
|
|||
union { void *a; };
|
||||
};
|
||||
}
|
||||
|
||||
namespace PR16596 {
|
||||
class A { public: virtual ~A(); };
|
||||
typedef const A Foo;
|
||||
void Apply(Foo processor);
|
||||
struct Bar : public Foo {};
|
||||
void Fetch() {
|
||||
Apply(Bar());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue