Skip to content

[diff.basic] Should we add an example for the case mentioned in CWG2836?Β #8563

@frederick-vs-ja

Description

@frederick-vs-ja

Even though std::float64_t is invalid in C, we can say "the type of 0.0f64" or just such a literal in both C and C++ (when it's supported).

As mentioned in CWG2836, when long double, double, and std::float64_t/_Float64 have the same format, the following example would be valid in C but invalid in C++.

auto x = 0.0f64;
auto y = 0.0l + 0.0f64;
auto p = true ? &x : &y;

Given C++26 has been rebased onto C23, it seems OK to have such an example in Annex C.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-OtherTriaged issue not in P1 or P2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions