473,765 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

incompatibility of PGI compiler ?

Following small test-program (see below) compiles fine with multiple
versionS of gcc, icc, xlC, aCC, pathscale but not with the PGI compiler.
The PGI 6.1 compiler tells me following:

<error>
"test.cpp", line 12: error: more than one operator "<<" matches these
operands:
function "std::operator< <(std::basic_os tream<char,
std::char_trait s<char>> &, const
std::complex<do uble> &)"
function "mine::operator <<(std::ostre am &, const
std::complex<do uble> &)"
operand types are: std::ostream << std::complex<do uble>
std::cout << d << std::endl ;
^

1 error detected in the compilation of "test.cpp".
</error>

Now I'm wondering if PGI is right or all others are right? Due to Koenig
lookup the compiler logically is going to search in the std namespace
too so the error generated by PGI looks plausible.

Additionally, does anybody know of any unconforming behaviour of the PGI
compiler ?

Thanks,

toon
<test.cpp>
#include <complex>
#include <iostream>

namespace mine {

std::ostream& operator<<(std: :ostream& os,std::complex <double> const & v)
{ std::cout << "mine::operator <<" << std::endl ; return os ; }

void foo()
{
std::complex<do uble> d ;
std::cout << d << std::endl ;
}
}
</test.cpp>
Mar 3 '06 #1
2 2150
On Fri, 03 Mar 2006 13:25:52 +0100, Toon Knapen
<"reverse[nepank.noot]"@fft.be> wrote:
Following small test-program (see below) compiles fine with multiple
versionS of gcc, icc, xlC, aCC, pathscale but not with the PGI compiler.
What compiler is this?
The PGI 6.1 compiler tells me following:

<error>
"test.cpp", line 12: error: more than one operator "<<" matches these
operands:
function "std::operator< <(std::basic_os tream<char,
std::char_trait s<char>> &, const
std::complex<d ouble> &)"
function "mine::operator <<(std::ostre am &, const
std::complex<do uble> &)"
operand types are: std::ostream << std::complex<do uble>
std::cout << d << std::endl ;
^

1 error detected in the compilation of "test.cpp".
</error>

Now I'm wondering if PGI is right or all others are right? Due to Koenig
lookup the compiler logically is going to search in the std namespace
too so the error generated by PGI looks plausible.

Additionally , does anybody know of any unconforming behaviour of the PGI
compiler ?

Thanks,

toon
<test.cpp>
#include <complex>
#include <iostream>
You should also #include <ostream> here...
namespace mine {

std::ostream& operator<<(std: :ostream& os,std::complex <double> const & v)
{ std::cout << "mine::operator <<" << std::endl ; return os ; }

void foo()
{
std::complex<do uble> d ;
std::cout << d << std::endl ;
}
}
</test.cpp>


Your code compiles and runs fine on MSVC++ ver. 7.1. Looks like a bug
in your compiler to me.

--
Bob Hairgrove
No**********@Ho me.com
Mar 3 '06 #2
Bob Hairgrove wrote:
On Fri, 03 Mar 2006 13:25:52 +0100, Toon Knapen
<"reverse[nepank.noot]"@fft.be> wrote:

Following small test-program (see below) compiles fine with multiple
versionS of gcc, icc, xlC, aCC, pathscale but not with the PGI compiler.

What compiler is this?


PGI? See http://www.pgroup.com/
xlC is IBM's compiler on IBM Aix

There are pretty well known for generating efficient code just like the
pathscale compiler.
Your code compiles and runs fine on MSVC++ ver. 7.1. Looks like a bug
in your compiler to me.

Probably but I'm trying to figure out on what grounds (i.e. based on
which paragraph(s) in the standard) ?

toon
Mar 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1094
by: hannibal | last post by:
Hi i have a netscape and IE incompatibility problem. when i change the text size in netscape everything looks fine and all frames text size change . but when i change the text size in IE just one frame change! can some one help me to debug this problem? http://w3.uqo.ca/d_info/ thanks
6
1297
by: przemek drochomirecki | last post by:
Hi, I don't understand the idea behind the error in the following code... int foo(const char **p) { return 0; } int main(int argc, char **argv) { foo(argv);
7
1253
by: Zara | last post by:
I am trying to publish one function in a template based on and derived of, a base class. The code tested in GCC works fine, and AFAIK is standard ISO. But I do have to make an inline fucntio for Borland C++ 5.6.4 (most recent version). Is this OK? Is there another way? Am I wrong on my ISO assumptions? Thanks to all J.A.Zaratiegui SOURCE follows:
6
5251
by: m0002a | last post by:
I have sucessfully set up an HADR pair of databases. Everthing works fine for the primary and secondary HADR databases, and manual takeover works fine. When I try to set up the second pair of databases for HADR in the same instance, I get the following error message (I already sucessfully started the standby database): $ db2 start hadr on db tdsapp as primary SQL1768N Unable to start HADR. Reason code = "99".
3
5481
by: Joshua Moore | last post by:
I have a webservice that serializes a ton of variables and other good stuff to a txt file using SoapFormatter (IFormatter), and when I try to deserialize it using the binary formatter, i get the following error: BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version 1986938170.1886350437. I've read a lot about this error from several sources on the net, but can't
2
5820
by: Doug Lind | last post by:
Hi all, I have seen a number of posts re: the BinaryFormatter version incompatibility but nothing on how to recover from it. In my case, I want the exception to trigger an alternate behaviour and continue process the stream. My app reads and writes configuration settings to a binary file upon starting and shutdown. The settings are stored in various objects that are serialized and deserialized using a BinaryFormatter. When reading...
0
991
by: GG | last post by:
Does anybody know the msdn website that shows the incompatibility between vs2005 and vs2003? Thanks *** Sent via Developersdex http://www.developersdex.com ***
5
2044
by: J | last post by:
I have installed dotnet 2.0 on two machines with Outlook BCM, and both have caused problems with BCM loading. The first i restored the machine to before the dotnet 2.0 was installed, and the second i removed BCM after which Outlook opened fine. Is there a patch for this? If there is can i bundle it with my app? App is coded with DotNet 2.0 VB Thank you - Ed
4
2250
by: rlrcstr | last post by:
I'm getting an annoying exception: BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version XXXX I've looked all over the web and everything that discusses this seems to be associated with web services. Usually indicating that the code is mismatched with BinaryFormatter and SOAPFormatter objects. Stressing that if you use a BinaryFormatter on one side you must use one on the other. Well, I'm only using...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.