Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351612

Summary: Pure virtual implementation not recognized if multiply inherited
Product: [Tools] CDT Reporter: Chris Long <chrislong>
Component: cdt-codanAssignee: Nathan Ridge <zeratul976>
Status: VERIFIED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, ckluss, dion, ecbugreport, kosashi, lech, malaperle, mnl, oleg8000, peterminin, petter.kvalvaag, yevshif
Version: 8.0   
Target Milestone: 8.2.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Shows how multiple inheritance and virtual methods generate bogus error marker none

Description Chris Long CLA 2011-07-09 01:15:19 EDT
Build Identifier: 20110615-0604

I'm working with a library that has lots of examples of the diamond pattern of multiple inheritance. I've noticed that with CDT 8.0 (indigo), it does not recognize that a pure virtual method has been implemented in one of the parents.

I've found I can work around it with a "using" directive, but this pattern is pervasive in this library and I'm going to have to do this a lot if I go with the "using" approach.

I'll attach a small example in a minute.


Reproducible: Always

Steps to Reproduce:
1. Multiply inherit from a common class that declares a pure virtual method.
2. One intermediate superclass implements the method, the other doesn't.
3. Instantiate the child class.
4. See a (bogus) error marker.
Comment 1 Chris Long CLA 2011-07-09 01:16:31 EDT
Created attachment 199368 [details]
Shows how multiple inheritance and virtual methods generate bogus error marker
Comment 2 Mb Rep CLA 2011-08-15 05:37:09 EDT
i wonder why this problem is not classified higher. this is an obvious bug and it happens in daily use.. (here too)
Comment 3 Peter Minin CLA 2013-03-28 20:26:34 EDT
Still not fixed 1.5 years after being reported... Eclipse Juno, CDT 8.1.2.201302132326
Comment 4 Petter Moe Kvalvaag CLA 2013-05-21 10:50:35 EDT
I'm in a similar situation as Chris, we have third party libs using lots of diamond inheritance. For me, this is actually the one major annoyance with the CDT right now.
Comment 5 Marc-André Laperle CLA 2013-06-27 09:47:49 EDT
*** Bug 364236 has been marked as a duplicate of this bug. ***
Comment 6 CDT Genie CLA 2013-07-28 16:22:06 EDT
*** cdt git genie on behalf of Nathan Ridge ***

    Bug 351612 - Pure virtual implementation not recognized if multiply
    inherited
    Change-Id: I1e9141fbb5cc72bb7b59b77d6faf958726094e5f
    Signed-off-by: Nathan Ridge &lt;zeratul976@xxxxxxxxxxx&gt;
    Reviewed-on: <a  href="https://git.eclipse.org/r/14906">https://git.eclipse.org/r/14906</a>
    Reviewed-by: Sergey Prigogin &lt;eclipse.sprigogin@xxxxxxxxx&gt;
    IP-Clean: Sergey Prigogin &lt;eclipse.sprigogin@xxxxxxxxx&gt;
    Tested-by: Sergey Prigogin &lt;eclipse.sprigogin@xxxxxxxxx&gt;

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=266e36403abcedec29241f6f38eab7616e6820d3
Comment 7 Marc-André Laperle CLA 2013-07-29 12:13:24 EDT
Fixed in 8.2.1 and master.
Comment 8 Marc-André Laperle CLA 2013-08-31 01:13:59 EDT
Verified in 8.2.1 RC1 (EPP 20130821-2252).
Comment 9 Christoph Lechleitner CLA 2013-10-20 06:00:51 EDT
Are you really sure the problem is fixed for all cases of multiple inheritance?

We still have the problem with C/C++ Development Tools 8.2.1.201309180223.

In our case (HttpClientTransportImpl and HttpServerTransportImpl in http://svn.clazzes.org/svn/fancylibs/trunk/fancylibs/src/fancysock/fancysockhttptransport.cpp), we don't have a single inheritance diamond providing only 2 paths to the pure virtual definition, but a pile of diamonds with probably 4 or 6 paths.
This might not be pretty, but we believe in implementation hiding.

Is there some hidden cache not totally rebuilt with C++Index/Rebuild, eventually keeping alive false-negative analysations from former CDT versions?
Comment 10 Marc-André Laperle CLA 2013-10-20 17:21:32 EDT
(In reply to Christoph Lechleitner from comment #9)
> Are you really sure the problem is fixed for all cases of multiple
> inheritance?

I can reproduce your issue with both CDT 8.2.1 and the master branch. I created bug 419938 to track it and added sample code.
Comment 11 Christoph Lechleitner CLA 2013-10-20 18:20:09 EDT
Thanks a lot!
Comment 12 Christoph Lechleitner CLA 2013-12-16 11:53:17 EST
I can confirm that the resolution of the follow-up issue #419938 (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=419938#c2) fixes my variant of the problem.

Tested in Eclipse 4.4M4 with CDT's nighty build.

Thanks again.
Comment 13 Marc-André Laperle CLA 2014-04-18 16:16:38 EDT
*** Bug 374422 has been marked as a duplicate of this bug. ***