зеркало из https://github.com/microsoft/clang-1.git
An inherited virtual (where "virtual" wasn't written explicitly) can
be defined as pure. Fixes PR5656. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90237 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
360f075fc6
Коммит
d3a505827f
|
@ -3393,7 +3393,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) {
|
|||
Expr *Init = static_cast<Expr *>(init.get());
|
||||
if ((IL = dyn_cast<IntegerLiteral>(Init)) && IL->getValue() == 0 &&
|
||||
Context.getCanonicalType(IL->getType()) == Context.IntTy) {
|
||||
if (Method->isVirtualAsWritten()) {
|
||||
if (Method->isVirtual()) {
|
||||
Method->setPure();
|
||||
|
||||
// A class is abstract if at least one function is pure virtual.
|
||||
|
|
|
@ -104,3 +104,11 @@ namespace T7 {
|
|||
virtual b* f();
|
||||
};
|
||||
}
|
||||
|
||||
// PR5656
|
||||
class X0 {
|
||||
virtual void f0();
|
||||
};
|
||||
class X1 : public X0 {
|
||||
void f0() = 0;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче