Skip to content

[expr.reflect] Last example assumes sizeof(int)!=1 without saying as such #9330

Description

@Halalaluyafail3

[expr.reflect] example 4:

template<typename T> void fn() requires (^^T != ^^int);
template<typename T> void fn() requires (^^T == ^^int);
template<typename T> void fn() requires (sizeof(T) == sizeof(int));

constexpr std::meta::info a = ^^fn<char>;       // OK
constexpr std::meta::info b = ^^fn<int>;        // error: ambiguous

The validity of these being different only makes sense if sizeof(int) is not one. Replacing int with a type such as char[2] would remove the assumption.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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