Trigraphs are evaluated both before and after line splicing

Open
#240 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
compilers

Research direction

Start with the Wave Driver preprocessing path using the three-line snippet from the issue and compare its result with the expected output shown there. Trace the ordering of trigraph conversion and line splicing, then add or run coverage for this example so completion is demonstrated by the expected output.

Written by the indexing model from the issue text.

Description

Just discovered that the Wave Driver (not sure about other setups) preprocesses the following code in a way that doesn't conform to the standard:

???/
?=define X 2
X

Is evaluated as 2, while the standard (at least from what I know, would love a source on this) says trigraphs aren't supposed to be evaluated after line splicing happens. Therefore, I believe the correct way to process the above snippet should be to convert ??/ to \, see there are no more trigraphs to convert, splice the first two lines into ??=define X 2, and then not to convert the ??= trigraph to a # because we've already spliced lines. Expected output is as follows:

??=define X 2
X
Dominant language
C++
Stars
29
Forks
55
PR merge metrics
No merged PRs in 30d

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.

More from boostorg/wave

All issues in boostorg/wave

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.