Bug 94302 - [DR 2310] Type completeness and derived-to-base pointer conversions
Summary: [DR 2310] Type completeness and derived-to-base pointer conversions
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks: c++-core-issues
  Show dependency treegraph
 
Reported: 2020-03-24 16:10 UTC by Marek Polacek
Modified: 2021-09-16 08:03 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-09-16 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-03-24 16:10:07 UTC
This issue was approved as a DR at Kona 2019:

  template<typename A, typename B> struct check_derived_from { 
    static A a; 
    static constexpr B *p = &a; 
  }; 
  struct W {}; 
  struct X {}; 
  struct Y {}; 
  struct Z : W, 
    X, check_derived_from<Z, X>,  // #1 
    check_derived_from<Z, Y>, Y { // #2 
    check_derived_from<Z, W> cdf; // #3 
  }; 


All three attempted conversions in the example are ill-formed.
Comment 1 Andrew Pinski 2021-09-16 08:03:16 UTC
Confirmed.