Message: previous - next
Month: April 2012

Re: [trinity-devel] c/c++ gurus - Help? [ was Re: [trinity-devel] Now kipi-plugins failing?? error: redeclaration of 'TQListViewItemIterator it']

From: Darrell Anderson <humanreadable@...>
Date: Tue, 10 Apr 2012 16:32:08 -0700 (PDT)
> >> The error message makes sense.
> >>
> >> The declaration of TQListViewItemIterator
> it(d->listView); occurs five times, each time in a
> different function.
> >>
> >> Apparently in function slotAddImages the
> declaration is seen twice. Once from the explicit
> declaration and once indirectly through a call to one of the
> other functions.
> >>
> >> The first question is why gcc 4.7 doesn't like this
> when previous versions have. The second question is how to
> fix. I understand the message, but lack the C++ skills to
> know the remedy. Probaby easy for the C++ gurus.
> > 
> > I 'think' it is this:
> > 
> > -> G++ now correctly implements the two-phase lookup
> rules such that an unqualified name used in a template must have:
> > 
> > (1) an appropriate declaration found either in scope at
> the point of definition of the template; or
> > 
> > (2) by argument-dependent lookup at the point of
> instantiation.
> > 
> > The question is if you have (1) & (2) instead of
> (1) | (2) do you get this redeclaration error??
> > 
> The failure continues as of today. As Darrell pointed out,
> there are multiple declarations of 'TQListViewItemIterator it( d->listView
> )' in kipi-plugins/flickrexport/imageslist.cpp that are now both
> seen by gcc 4.7. Could one of the c/c++ gurus take a look at suggest how to
> make sure this is only seen once? Thanks.

I won't say for sure, but in commit 21705d1b 2012-04-05 where I cleaned some typos, that effort inadvertently created two identical declarations. The code never failed previously because the typos actually caused two different declarations, one of which was no longer being used. The remaining declaration one was abandoned in place, so to speak, but caused no harm. My typo scrubbing caused the two declarations to become identical. I had to fix that in commit 63df5ccd 2012-04-06.

Point being? Let the gurus decide but I think only one of the five declarations is being duplicated, but perhaps the solution is as simple as deleting the explicit declaration in function slotAddImages.