Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.

alias-declaration issue in 15.0

x_x_
Beginner
314 Views

The following code does not compile:

using Type alignas(4) = int;

According to clause 7 of the standard I think it should:
7 (1):
alias-declaration: using identifier attribute-specifier-seqopt = type-id ;
7.6.1 (1):
attribute-specifier-seq:
attribute-specifier-seqopt attribute-specifier
attribute-specifier:
[ [ attribute-list ] ]
alignment-specifier
alignment-specifier:
alignas ( type-id ...opt)
alignas ( alignment-expression ...opt)

I use MSVC2013 and either the v120 or CTP_Nov2013 base platform toolset.

Both Microsoft compilers don't compile either. Is this the reason why yours doesn't compile (just like with no implicit move semantics generation)?

If so, is there an undocumented compiler switch like "Qoption,cpp,--alias_declaration"?

0 Kudos
3 Replies
Kittur_G_Intel
Employee
314 Views

Hi,

Based on reading the spec you mention it should be: 

   using A alignas(16) = int;

     or

   using A = int alignas(16);

Anyways, I just responded to similar thread you posted on typedef and looks like it's not supported or implemented and will file this with the developers. I"ll get back to you as soon as I've an update accordingly, appreciate much.

_Kittur

x_x_
Beginner
314 Views

Hi Kittur,

yes, I think the second form you mention (with alignas on the right) is legal because according to 8.1 (1) type-id can be:

type-specifier-seq noptr-abstract-declaratoropt[ constant-expressionopt ] attribute-specifier-seqopt

Thus:

alias-declaration: using identifier attribute-specifier-seqopt = type-specifier attribute-specifier-seqopt ;

Kittur_G_Intel
Employee
314 Views

Hi,

Yes, that's legal I agree and the tracker number is: DPD200361116 and will keep posted on any update I get on this, thanks.

_Kittur 

Reply