[expr.shift] p1 What is the promoted type of a source type to which integral promotion does not apply?
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
[expr.shift] p1 says
The operands shall be of integral or unscoped enumeration type and integral promotions are performed. The type of the result is that of the promoted left operand.
Consider this example:
long int i = 0;
i << 1;
The left operand's type is long int whose integer conversion rank is greater than int, thus [conv.prom] p1 cannot apply to such a type, as per the following:
A prvalue of an integer type other than bool, char8_t, char16_t, char32_t, or wchar_t whose integer conversion rank ([conv.rank]) is less than the rank of int can be converted to a prvalue of type int...
So, what is the promoted type if the integral promotion does not apply at all? Shall we improve [expr.shift] p1 to the following to clarify this vague?
The operands shall be of integral or unscoped enumeration type and integral promotions are performed(if necessary). The type of the result is that of the possibly promoted left operand.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with [expr.shift] p1 and [conv.prom] p1, using the long int example to verify how the wording applies when no promotion changes the type. Done means resolving whether the existing text is sufficiently precise or adopting wording that clearly covers an unpromoted operand.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100