Bug 95093 (cwg1966) - Implement DR 1966, Colon following enumeration elaborated-type-specifier
Summary: Implement DR 1966, Colon following enumeration elaborated-type-specifier
Status: NEW
Alias: cwg1966
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks: c++-core-issues
  Show dependency treegraph
 
Reported: 2020-05-12 19:30 UTC by Marek Polacek
Modified: 2021-12-14 04:55 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-12-14 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Polacek 2020-05-12 19:30:44 UTC
In C++11

  enum E { };
  void f(bool b)
  {
    E e = b ? *new enum E : E{};
  }

should now compile: the colon is not an enum-base, it's part of a ternary operator.  But we think we're defining a new type here, and reject it.

See http://wg21.link/cwg1966
Comment 1 ensadc 2020-05-12 23:40:45 UTC
Probably related/covered in https://wg21.link/cwg2141 (PR50169).
Comment 2 Andrew Pinski 2021-12-14 04:55:12 UTC
Confirmed.