Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

explicit keyword?

pete_a90
Beginner
899 Views
Does the explicit keyword work in 7.0? More specifically will this snippit fail:

struct Asdf {
explicit Asdf(const int = 0) {}
};

Asdf foo()
{
// supposed to error here
return 4;
}

void foo2()
{
// supposed to error here too
Asdf i = 4;
}

void foo3()
{
Asdf i;
// 6.0 detects this
i = 4;
}
0 Kudos
3 Replies
Maximillia_D_Intel
899 Views
For best results, I think you should file a Quad.

Our 7.0 compiler detects the error at 21, but does not at 8 and 14. Our 7.0 Linux compiler detects the errors at 8,14, and 21.

It seems MSVC 7X detects errors at 8, 14, and 21. MSVC 6 detects errors at 14 and 21.

I would conclude that there's an issue to look at with icl.

Max
[Intel Compiler Team]
0 Kudos
pete_a90
Beginner
899 Views
Does that mean the linux and windows versions come from separate code bases? I was hoping to see some gcc extensions in the windows version in the future (and I'm sure __declspec(property) would be nice in the linux version if it doesn't support that already). By the way, what does "filing a Quad" mean and how do I go about doing that?
0 Kudos
TimP
Honored Contributor III
899 Views
QuAD refers to the name which the Intel bug reporting site had some time prior to when I was hired. Open up an account on https://premier.intel.com and submit a report. Under "all products" you should be prompted to select the appropriate compiler category. You will be asked to run the command line program icid, e.g. from the Intel compiler environment command line window, to determine which software versions are active, as part of your submission.

I, too, would like to see more gcc compatibility in the Windows compiler, but Microsoft and standards compatibility are far higher priorities. Your requests might get more attention if you emphasize how they improve portability of your application between Intel Windows and linux compilers.
0 Kudos
Reply