mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
fix Issue 23866 - ImportC: Multiple __declspecs rejected
This commit is contained in:
parent
d11ec36040
commit
632a011f11
2 changed files with 14 additions and 6 deletions
|
@ -2350,12 +2350,15 @@ final class CParser(AST) : Parser!AST
|
|||
* struct-or-union gnu-attributes (opt) identifier (opt) { struct-declaration-list } gnu-attributes (opt)
|
||||
* struct-or-union gnu-attribute (opt) identifier
|
||||
*/
|
||||
if (token.value == TOK.__attribute__)
|
||||
cparseGnuAttributes(tagSpecifier);
|
||||
|
||||
if (token.value == TOK.__declspec)
|
||||
cparseDeclspec(tagSpecifier);
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (token.value == TOK.__attribute__)
|
||||
cparseGnuAttributes(tagSpecifier);
|
||||
else if (token.value == TOK.__declspec)
|
||||
cparseDeclspec(tagSpecifier);
|
||||
else
|
||||
break;
|
||||
}
|
||||
t = cparseStruct(sloc, structOrUnion, tagSpecifier.packalign, symbols);
|
||||
tkwx = TKW.xtag;
|
||||
break;
|
||||
|
|
5
compiler/test/compilable/test23866.i
Normal file
5
compiler/test/compilable/test23866.i
Normal file
|
@ -0,0 +1,5 @@
|
|||
// https://issues.dlang.org/show_bug.cgi?id=23866
|
||||
|
||||
struct __declspec(align(16)) __declspec(no_init_all) S { };
|
||||
|
||||
typedef struct __attribute__((aligned(16))) __declspec(no_init_all) S2 { } S2;
|
Loading…
Add table
Add a link
Reference in a new issue