My Oracle Support Banner

"Error: Overloading Ambiguity ..." When Using Standard Functions in C++ (Doc ID 1002026.1)

Last updated on NOVEMBER 01, 2024

Applies to:

Oracle Solaris Studio - Version Forte Developer 6 Update 2 to 12.4 [Release 6.0 to 12]
Oracle Solaris on x86-64 (64-bit)
Oracle Solaris on x86 (32-bit)
Oracle Solaris on SPARC (64-bit)
Oracle Solaris on SPARC (32-bit)
All Platforms

Symptoms

In default -compat=5 mode, the Oracle Solaris Studio/Sun Studio C++ compiler rejects a call to a mathematical standard function with an overloading ambiguity error message such as:

  "foo.cpp", line 10: Error: Overloading ambiguity between "std::sqrt(double)" and "std::sqrt(long double)"


OR

 "bar.cc", line 9: Error: Overloading ambiguity between "std::abs(int)" and "std::abs(double)".


OR
 

"test.cpp", line 9: Error: Overloading ambiguity between "std::pow(double, int)" and "std::pow(long double, int)".

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.