On Wed, Jun 6, 2012 at 9:20 PM, John McCall <[email protected]> wrote: > On Jun 6, 2012, at 5:23 PM, Aaron Ballman wrote: >> On Mon, Jun 4, 2012 at 4:17 PM, Aaron Ballman <[email protected]> wrote: >>> This patch is to fix PR12631, and basically just turns on existing >>> functionality. __declspec(align)'s behavior (documented on MSDN here: >>> <http://msdn.microsoft.com/en-us/library/83ythb65(v=vs.100).aspx>) >>> matches what we already support for __attribute__((aligned)). I've >>> also included a test case to ensure the behavior matches expectations. > > __attribute__((aligned)) is a little funny in that it's got multiple spellings > ("align" and "aligned") and takes 0 or 1 arguments. I think this patch will > make us accept "__declspec(align)" and "__declspec(aligned(16))"; I > assume that the latter is wrong and the former might be wrong. > > In either case, you should be able to filter these easily by checking the > identifier info on the parsed attribute, as well as whether it has an > argument. Please also test these possibilities.
You are correct, but it's a bit moot. We don't emit any diagnostics for unknown or malformed declspecs. I've added some logic to test whether the identifier is wrong, or if it is missing a parameter. However, the fact still remains that declspecs aren't properly diagnosed anyway. So I didn't add any test cases for those possibilities. So I think my next patch will be a refactoring of the way we parse declspecs so that we handle them a bit better. With that patch, I'll go ahead and add diagnostics for aligned and align sans parameter and make some more comprehensive tests. ~Aaron
declspec_align.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
