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

C++ Compiler 15.0, initializer syntax issue

Martin_Z_1
Beginner
579 Views

The following example code produces the compiler error "c:/temp/test.cpp(12): error #453: protected function "C1::C1(int)" (declared at line 4) is not accessible through a "C1" pointer or object" using command line "icpc.exe -std=c++11 c:\temp\test.cpp".

class C1
{
protected:
    C1(int a)
    {
    }
};

class C2 : public C1
{
public:
    C2() : C1{2}
    {
    }
}; 

It compiles if we change initializer syntax in line

    C2() : C1{2}

to constructor syntax

    C2() : C1(2)

Is this a bug? Thank you for clarification in advance.

0 Kudos
6 Replies
QIAOMIN_Q_
New Contributor I
579 Views

Hello Martin,

What's your specific Intel compiler version and Visual studio version? Let me try to reproduce the problem first.

 

 

Thank you.
--
QIAOMIN.Q
Intel Developer Support
Please participate in our redesigned community support web site:

User forums:                   http://software.intel.com/en-us/forums/

0 Kudos
Martin_Z_1
Beginner
579 Views

Hello QIAOMIN.Q,

well, I'll try to answer:

>...specific Intel compiler version...

As the TOPIC title says we are using version 15.0. Still more specific? Unfortunately "...Composer XE 2015\bin\intel64_mic\Icpc.exe" itself has no embedded file version information. (Accompanying icc.exe in the same folder is version 15.0.0.0).

>...specific ... Visual studio version...

As DESCRIBED we are using icpc.exe from the command line. Without Visual Studio. (Apart from that: We would like to get rid of the MSVC++ compiler. It is unusable from VS2013 Update 2 and completely broken with VS2013 Update 3.)

If I didn't understood you right, please tell me what information you exactly need. Or please tell me if this command line works on your machine.

Best regards, Martin

0 Kudos
TimP
Honored Contributor III
579 Views

As there has been only one 15.0 release version, it may not be necessary, but "icpc -V" and "cl" give the full information, including answering the question whether you are looking at ia32 or Intel64.

Command line invocation doesn't change the use of a combination of Microsoft and Intel headers and libraries.  Much of the c++11 support depends on VS2013.  As you said yourself, VS2013 update version may make a difference, and Microsoft is unlikely to straighten this out without some influential prodding.

0 Kudos
Martin_Z_1
Beginner
579 Views

(The "intel64_mic>icpc.exe" has version 15.0 Build 2014726.)


Because "intel64\icl.exe" (which has the same reported issue) is more relevant for us at the moment I would like to demonstrate the configuration/procedure for this compiler version:
1) Open a standard cmd-Window (not a Visual Studio command prompt or anything like this).
2) C:\Program Files (x86)\Intel\Composer XE 2015\bin>iclvars.bat intel64 vs2013
3) C:\Program Files (x86)\Intel\Composer XE 2015\bin>intel64\icl.exe -Qstd=c++11 c:\temp\test.cpp

The compiler error is exactly the same as in my first post.

Version numbers:
The "intel64\icl.exe" reports "Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.108 Build 20140726"
The "cl.exe" reports "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64".

Thank you in advance.

0 Kudos
QIAOMIN_Q_
New Contributor I
579 Views

Hello Martin,

  Seems this is also a C++11 related bug. I have reproduced as you said and will enter this issue into our problem-tracking database.Thank you for submitting the issue.I'll get this posted whenever I have an update from our development team.


Thank you.
--
QIAOMINQ.
Intel Developer Support

0 Kudos
Daniel_V_2
Beginner
579 Views

This bug still exists in Intel Composer 2016, i.e. icpc version 16.0.0. What's the status on an expected fix?

0 Kudos
Reply