D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21340 - extern(C++,(emptyTuple)) should result in no namespace not an error
Summary: extern(C++,(emptyTuple)) should result in no namespace not an error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Mac OS X
: P1 enhancement
Assignee: No Owner
URL:
Keywords: C++
Depends on:
Blocks:
 
Reported: 2020-10-24 12:16 UTC by Nicholas Wilson
Modified: 2020-11-03 01:32 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 Nicholas Wilson 2020-10-24 12:16:31 UTC
```
extern(C++) 
    struct A {}
extern(C++,) 
    struct A {}
extern(C++, "")
    struct A {}
extern(C++,mixin(""))
    struct A {}
```
should be all equivalent, currently only the first compiles.

```
extern(C++, true ? "ns" : "")
    struct B {}
```

compiles, but

```
extern(C++, false ? "ns" : "")
    struct B {}
```

does not.
Comment 1 Dlang Bot 2020-10-25 00:25:37 UTC
@thewilsonator created dlang/dmd pull request #11905 "Fix issue 21340- extern(C++,) extern(C++, "") and extern(C++,mixin(""…" fixing this issue:

- Fix issue 21340- extern(C++,) extern(C++, "") and extern(C++,mixin("")) should result in no namespace not an error

https://github.com/dlang/dmd/pull/11905
Comment 2 Nicholas Wilson 2020-10-25 00:32:44 UTC
that should be 

extern(C++,mixin("\"\""))
    struct A {}
Comment 3 Dlang Bot 2020-10-27 12:53:57 UTC
@thewilsonator created dlang/dlang.org pull request #2872 "document issue 21340 - extern(C++, (emptyTuple))" mentioning this issue:

- document issue 21340 - extern(C++, (emptyTuple))

https://github.com/dlang/dlang.org/pull/2872
Comment 4 Dlang Bot 2020-11-02 13:04:51 UTC
dlang/dmd pull request #11905 "Fix issue 21340 - extern(C++,(emptyTuple)) should result in no namespace not an error" was merged into master:

- 17845af13059f8d03dc80af0fdcbcf639b877c13 by Nicholas Lindsay Wilson:
  Fix issue 21340 - extern(C++,(emptyTuple)) should result in no namespace not an error

https://github.com/dlang/dmd/pull/11905
Comment 5 Dlang Bot 2020-11-03 01:32:12 UTC
dlang/dlang.org pull request #2872 "Document issue 21340 - `extern(C++, (expression))` now accepts empty tuples" was merged into master:

- 4f3b1fad4532e2513c5ef74ed288419933b27ab7 by Nicholas Lindsay Wilson:
  document issue 21340 - extern(C++, (emptyTuple))

https://github.com/dlang/dlang.org/pull/2872