Skip to content

Clang 20 implicit CTAD regression? #134613

@ngladitz

Description

@ngladitz
#include <type_traits>

template<typename R>
struct Foo
{
	using value_type = R ;

	Foo() = default;
    Foo(const Foo&) = delete;
    Foo(Foo&&) = delete;

	Foo(Foo<Foo<R>>&& rhs)
	{
	}
};

/*template<typename R>
Foo(Foo<Foo<R>>&&) -> Foo<R>;*/

int main()
{
	auto r1 = Foo(Foo<Foo<int>>{});
	static_assert(std::is_same_v<decltype(r1)::value_type, int>);
}

Compiles with Clang 19.1.0 but fails the static_assert with Clang 20.1.0: https://godbolt.org/z/daqjan7e5
Uncommenting the explicit deduction guide seems to work around the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions