fix Issue 23866 - ImportC: Multiple __declspecs rejected

This commit is contained in:
Walter Bright 2023-04-29 22:53:49 -07:00 committed by The Dlang Bot
parent d11ec36040
commit 632a011f11
2 changed files with 14 additions and 6 deletions

View file

@ -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;

View 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;