?? followed by ', (, ) and others in a C++ string is a trigraph
PitfallVerified 27 Sep 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
An error message such as "arithmetic or '??' (duql stage 12a2)" draws a clang warning:
Trigraph ignored [-Wtrigraphs]
Cause#
??', ??(, ??), ??=, ??/, ??!, ??<, ??> and ??- are trigraphs. C++17 removed them, so clang ignores them but warns; an older standard mode or another compiler may replace them.
Fix#
Do not write ?? directly before one of those characters in a literal. Reword ("a coalesce"), or split the literal: "'?" "?'". "??" followed by " or a letter is not a trigraph.
Evidence#
- dftracer-utils duql lowering (2026-09-27): clangd reported the warning on
src/dftracer/utils/duql/lower.cpp; after the rewording the full tests build had no warnings.