cplusplus / cplusplus/draft

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

Open
#8,563 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

P3-Other
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Annex C in the draft source and read the surrounding examples and conventions for C/C++ differences. Check the CWG2836 context and determine whether the supplied floating-point literal example fits there; done means the example is added or the issue is resolved with the rationale recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
tex
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.