Skip to content

[basic.start.main] Clarify what it means to "use" main CWG2811 #6563

@Eisenwave

Description

@Eisenwave

The current wording in [basic.start.main] p3 is:

The function main shall not be used within a program.

There is no forward reference for what "use" refers to and the word doesn't seem to be defined anywhere, so I'm pretty sure this is meant to mean odr-use:

A function is odr-used if it is named by a potentially-evaluated expression or conversion.

- [basic.def.odr] p8

  1. Can we just replace "use" with "odr-use"?
  2. Is CWG intent clear enough for this to be non-editorial or is there more to it?

C++98 Wording

The function main shall not be used (3.2 [basic.def.odr]) within a program.

- [basic.start.main] p3

An object or non-overloaded function is used if its name appears in a potentially-evaluated expression.

- [basic.def.odr] p2

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