Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e29fbaf authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar
Browse files

Mark functions in IMtpDatabase as pure virtual

Bug: http://b/116873221

Mark beginCopyObject() and endCopyObject() as pure virtual.  If not,
Clang assumes that the TU which defines this function will contain the
vtable for the class as well.  Since there's no out-of-line definition
of this funciton, no TU ends up with the vtable.

This causes a problem with coverage builds, which are built with -O0,
where calls don't get inlined, thereby requiring a definition of the
vtable.  For non -O0 builds, the vtable is not required since the
virtual calls get inlined/optimized-out.

Test: Build with and without -O0.
Change-Id: I5e8dcf583a75af51af1e9dd31a6635aa2f9d4413
parent b4e48f1c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -112,8 +112,8 @@ public:
                                            MtpObjectHandle handle, bool succeeded) = 0;

    virtual MtpResponseCode         beginCopyObject(MtpObjectHandle handle, MtpObjectHandle newParent,
                                            MtpStorageID newStorage);
    virtual void                    endCopyObject(MtpObjectHandle handle, bool succeeded);
                                            MtpStorageID newStorage) = 0;
    virtual void                    endCopyObject(MtpObjectHandle handle, bool succeeded) = 0;
};

}; // namespace android