Skip to content

[clang] return type deduction fails for function recursively invoked via intermediate constexpr function #61041

@mcencora

Description

@mcencora

Following code fails to compile, unless constexpr qualifier is removed from visitType:

https://godbolt.org/z/899fWhdGe

struct visitor {
    template < typename T >
    static auto visit() {
        return visitType< T >();
    }

    template < typename T >
    static constexpr void visitType() {
        visit< typename T::next_type>();
    }
};

struct iface  {
    using next_type = iface;
};

void foo()
{
    visitor::visit<iface>();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions