D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20791 - extern(C++ <strings>) should allow a trailing comma
Summary: extern(C++ <strings>) should allow a trailing comma
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-05-01 19:49 UTC by moonlightsentinel
Modified: 2020-05-02 00:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2020-05-01 19:49:54 UTC
Compiling this code

================================
extern(C++, "foo",)
struct S {}
================================

fails with:

comma.d(1): Error: expression expected, not `)`
comma.d(2): Error: found `struct` when expecting `)`
comma.d(2): Error: no identifier for declarator `S`
comma.d(2): Error: declaration expected, not `{

This is inconsistent because a trailing comma is allowed for function arguments, array literals, ... .
Comment 1 Dlang Bot 2020-05-01 20:00:24 UTC
@MoonlightSentinel created dlang/dmd pull request #11090 "Fix Issue 20791 - extern(C++ <strings>) should allow a trailing comma" fixing this issue:

- Fix Issue 20791 - extern(C++ <strings>) should allow a trailing comma

https://github.com/dlang/dmd/pull/11090
Comment 2 Dlang Bot 2020-05-02 00:58:14 UTC
dlang/dmd pull request #11090 "Fix Issue 20791 - extern(C++ <strings>) should allow a trailing comma" was merged into master:

- a496a35e72832410726adf11ee45cbb9c81ead30 by MoonlightSentinel:
  Fix Issue 20791 - extern(C++ <strings>) should allow a trailing comma

https://github.com/dlang/dmd/pull/11090