- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page