C++ Logo

std-proposals

Advanced search

Re: C++ Standard and macro argument substitution

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Tue, 20 Oct 2020 17:06:31 -0400
On Tue, Oct 20, 2020 at 2:27 PM mircan via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> I have recently came across an interesting problem that might be related
> to a subject for improvement
>
IIUC, your discovery relates to
http://eel.is/c++draft/cpp.replace.general#13.sentence-3
> If there are sequences of preprocessing tokens within the list of
arguments that would otherwise act as preprocessing directives, the
behavior is undefined.

This wording has been challenged by at least these papers:
http://open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3801.pdf (make it
ill-formed instead of undefined)
http://www.open-std.org/JTC1/SC22/wg21/docs/papers/2014/n3882.pdf (make
execution of the directive "conditionally supported")
but as of C++20, it's still UB.

–Arthur

Received on 2020-10-20 16:06:46