You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The process of forming a header-name preprocessing token from pp-tokens in https://wg21.link/cpp.include#7 is bound to fail when the first such token is a string-literal whose spelling does not start with ". Such a failure is specified to be IFNDR.
As this process is invoked—potentially with such an input—from multiple places in the standard that use the header-name-tokens production (https://wg21.link/cpp.cond#nt:header-name-tokens), and implementations appear to diagnose this case (see https://godbolt.org/z/Y45jdbfeo), it may be prudent to make the case plain ill-formed.
Test case from Compiler Explorer link above:
#include L"hello"
This generates similar errors from GCC, Clang, EDG, and both MSVC preprocessor implementations.
Then, an attempt is made to form a header-name preprocessing token ([lex.header]) from the whitespace and the characters of the spellings of the resulting sequence of preprocessing tokens, which shall start with a string-literal only if its spelling begins with U+0022 QUOTATION MARK; the treatment of whitespace is implementation-defined.