Skip to content

[expr.const] Macro invocations during constant evaluation #806

@Endilll

Description

@Endilll

Reference (section label): [expr.const]

Issue description:

[expr.const] paragraphs 10:

An expression E is a core constant expression unless the evaluation of E, following the rules of the abstract machine ([intro.execution]), would evaluate one of the following:
— <...>
— an invocation of the va_arg macro ([cstdarg.syn]);

[expr.const] paragraph 12:

It is unspecified whether E is a core constant expression if E satisfies the constraints of a core constant expression, but evaluation of E would evaluate
— <...>
— an invocation of the va_start macro ([cstdarg.syn])

Macros do not exist by the time analysis regarding core constant expressions happens.

Suggested resolution:

Change [expr.const] bullet 10.30 as follows:

An expression E is a core constant expression unless the evaluation of E, following the rules of the abstract machine ([intro.execution]), would evaluate one of the following:
— <...>
an invocation of constructs resulting from the analysis of tokens expanded from the va_arg macro ([cstdarg.syn]);

Change [expr.const] bullet 12.2 as follows:

It is unspecified whether E is a core constant expression if E satisfies the constraints of a core constant expression, but evaluation of E would evaluate
— <...>
an invocation of constructs resulting from the analysis of tokens expanded from the va_start macro ([cstdarg.syn]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions