D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21530 - dtoh: Identifiers need to be sanitized wrt. reserved C++ keywords
Summary: dtoh: Identifiers need to be sanitized wrt. reserved C++ keywords
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-01-09 16:30 UTC by kinke
Modified: 2021-01-14 22:42 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 kinke 2021-01-09 16:30:32 UTC
E.g., from frontend.h:

enum class PASS
{
    inline = 7 // needs to be sanitized to `inline_` or so
};

See https://en.cppreference.com/w/cpp/keyword.
Comment 1 Dlang Bot 2021-01-10 16:09:58 UTC
@MoonlightSentinel created dlang/dmd pull request #12122 "Fix 21530 - dtoh: Sanitize identifiers wrt. reserved C++ keywords" fixing this issue:

- Fix 21530 - dtoh: Sanitize identifiers wrt. reserved C++ keywords
  
  Extends the check for C++ keywords to append an underscore instead of
  raising an error whenever the actual name doesn't matter for binary
  compatibility.

https://github.com/dlang/dmd/pull/12122
Comment 2 Dlang Bot 2021-01-14 22:42:07 UTC
dlang/dmd pull request #12122 "Fix 21530 - dtoh: Sanitize identifiers wrt. reserved C++ keywords" was merged into master:

- 843bc8549e264b9a4b127a6da8f98524d52f23b1 by MoonlightSentinel:
  Fix 21530 - dtoh: Sanitize identifiers wrt. reserved C++ keywords
  
  Extends the check for C++ keywords to append an underscore instead of
  raising an error whenever the actual name doesn't matter for binary
  compatibility.

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