Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364236 - Code analysis of virtual base classes is incomplete
Summary: Code analysis of virtual base classes is incomplete
Status: CLOSED DUPLICATE of bug 351612
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-20 08:34 EST by Michael N. Lipp CLA
Modified: 2013-06-27 09:47 EDT (History)
5 users (show)

See Also:


Attachments
The code that reproduces the problem (104.73 KB, application/zip)
2011-11-20 08:35 EST, Michael N. Lipp CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael N. Lipp CLA 2011-11-20 08:34:51 EST
Build Identifier: 20110615-0604

Omniorb (CORBA implemplementation) generates (correct) code that is considered incorrect by code analysis. I have stripped down the code to the basic problem, but I'm afraid it still needs a bit of explanation.

We have class CItf that defines a pure virtual function "tbi()". The implementation of the interface (includes more methods in omniorb) is split and provided by two classes CImplPart1 and CImplPart2 (of course I have omitted all the methods that are implemented by those classes in omniorb; the point in omniorb is that CImplPart1 is common to all eventually derived implementations, while CImplPart2 varies, i.e. may be replaced by different classes for supplying the particular methods).

Eventually the "fixed" part CImplPart1 and the "varying" part (represented here by CImplPart2) are combined again in a class "CCombinedImpl" that can be used to instanciate objects.

CImplPart2 contributes the implementation of the pure virtual "tbi()", but it does this using a private definition of the method. This is a bit strange but formally OK.

However, code analysis does not accept this implementation as satisfying the requirement for an implementation of the pure virtual method "tbi()" in CItf and puts an error marker at the declaration of an object of type CCombinedImpl in Test.cpp.

The code compiles nevertheless without even a warning. I've added "invokeTbi" simply to show that it also works as expected.


Reproducible: Always

Steps to Reproduce:
1. Unpack
2. Look at error marker
Comment 1 Michael N. Lipp CLA 2011-11-20 08:35:40 EST
Created attachment 207277 [details]
The code that reproduces the problem
Comment 2 Christof Kluß CLA 2013-06-22 06:21:55 EDT
seems to be the same bug as https://bugs.eclipse.org/bugs/show_bug.cgi?id=351612
Comment 3 Marc-André Laperle CLA 2013-06-27 09:47:49 EDT

*** This bug has been marked as a duplicate of bug 351612 ***