← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] compile broken on clang - overload conflict

 

On 6/8/2015 8:58 AM, Chris Pavlina wrote:
> It can't and it shouldn't - gcc is the one at fault here. wxString 
> provides the constructor:
> 
> wxString(char ch, size_t nRepeat=1)
> 
> which is the one in question, I believe, as the integer literal can also 
> represent a character.
> 
> Using a reference should work too, though changing the name is a more 
> common solution (and better IMHO) particularly considering the two 
> methods do provide slightly different functions.

I would think that searching a list with a string vs. an index is pretty
self explanatory but maybe I've been doing this too long :)

> 
> Apparently MSVC won't compile it either.
> 
> On Mon, Jun 08, 2015 at 08:50:15AM -0400, Wayne Stambaugh wrote:
>> Really!  Clang can't differentiate between
>>
>> SCH_SHEET_LIST::GetSheet(const wxString, bool);
>>
>> and
>>
>> SCH_SHEET_LIST::GetSheet(int);
>>
>> How can these two definitions be ambiguous?  Does using a reference to
>> the wxString instead of passing the entire string on the stack fix the
>> problem?  If so, I would prefer that fix.
>>
>> On 6/7/2015 9:17 PM, Chris Pavlina wrote:
>>> 5720 broke the build on clang by making SCH_SHEET_LIST::GetSheet(int) a 
>>> const method, which changed the overload resolution order and resulted 
>>> in failure due to ambiguity. This patch ranames 
>>> SCH_SHEET_LIST::GetSheet(const wxString, bool) to ::GetSheetByPath to 
>>> resolve that conflict.
>>>
>>> --
>>> Chris
>>>
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


Follow ups

References