Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » [GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous
[GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous [message #45003] Sat, 15 August 2015 22:35 Go to next message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
Hi,

When I am trying to turn on c++11 and compile even simplest application:
#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
}

gcc (4.8.4/ubuntu1~14.04) shows me this errors

/home/zbych/upp/uppsrc/Core/Other.h:98:70: error: call of overloaded 'pick(Upp::Any&)' is ambiguous
  void operator=(Any rval_ s)                   { Clear(); Pick(pick(s)); }
/home/zbych/upp/uppsrc/Core/Defs.h:391:5: note: T&& Upp::pick(T&) [with T = Upp::Any]
 T&& pick(T& x) { return static_cast<T&&>(x); }
/home/zbych/upp/uppsrc/Core/Defs.h:394:5: note: T&& Upp::pick(T&&) [with T = Upp::Any&]
 T&& pick(T&& x) { return static_cast<T&&>(x); }

It appears that gcc doesn't know which template it should use:

template <typename T>
T&& pick(T& x) { return static_cast<T&&>(x); }

template <typename T>
T&& pick(T&& x) { return static_cast<T&&>(x); }


How can I fix this errors?
Re: [GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous [message #45004 is a reply to message #45003] Sat, 15 August 2015 23:22 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Zbych,

For me it works fine I enable c++11 by common option in build methods. My build method settings look like this (part):
COMMON_OPTIONS = "-std=c++11";


This is my example, which test that c++11 is really enable:
#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
        // Simply C++11 for each loop - in C++03 compilation error
	int tab[3] = {1, 2, 3};
	for(int& i : tab)
		Cout() << i << "\n";
}


P.S.
I have the same GCC version.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sun, 16 August 2015 22:06]

Report message to a moderator

Re: [GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous [message #45006 is a reply to message #45004] Sun, 16 August 2015 12:16 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
I removed ~/.upp and ~/Upp directories and downloaded the newest version from svn (8813), but the problem persists.
It doesn't matter if I add "-std=c++11" via package organizer or setup/build methods.

I made the same test on another computer. After upgrade to svn 8813, gcc started showing the same errors.

If I remove these lines (from Defs.h):

template <typename T>
T&& pick(T&& x) { return static_cast<T&&>(x); }

gcc stops complaining.

[Updated on: Sun, 16 August 2015 12:58]

Report message to a moderator

Re: [GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous [message #45009 is a reply to message #45006] Sun, 16 August 2015 22:13 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Zbych,

Yes, you are right. I used old uppsrc for compiling above example. I added this bug to redmine: http://www.ultimatepp.org/redmine/issues/1234.

And of course, I would like to sorry you for the mess I have made Wink

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sun, 16 August 2015 22:17]

Report message to a moderator

Re: [GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous [message #45010 is a reply to message #45009] Mon, 17 August 2015 07:55 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
There is absolutely no need to be sorry.
I really appreciate your help and confirmation that I am not the only one who sees this error Smile

[Updated on: Mon, 17 August 2015 07:57]

Report message to a moderator

Re: [GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous [message #45021 is a reply to message #45010] Wed, 19 August 2015 20:56 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
It looks like incompatibility between CLANG and GCC. Nightly autotests run c++11 tests in clang... so this escaped my attention.

Anyway, should be now fixed. Please check.
Previous Topic: Division by 0 in Thread::Priority
Next Topic: Why Cout() and Cerr() work so different?
Goto Forum:
  


Current Time: Tue Apr 16 11:32:23 CEST 2024

Total time taken to generate the page: 0.01209 seconds