Skip to content

Alias template CTAD is erroneously allowed in C++17 mode #125913

@PJBoy

Description

@PJBoy

Alias template CTAD is a C++20 feature ( https://en.cppreference.com/w/cpp/compiler_support/20#cpp_deduction_guides_201907L ) recently introduced in clang v19. Seems it's being allowed in C++17 mode with no diagnostic ( https://godbolt.org/z/x7zdxnrqx ). Though a (almost correct) diagnostic is issued with the -Wpre-c++17-compat flag ( https://godbolt.org/z/acKsG3dfj ).

Testcase is replicated here

template<typename T, typename TT>
struct S
{
    T t;
    TT tt;
};

template<typename T, typename TT>
S(T, TT) -> S<T, TT>;

template<typename T>
using S_int = S<T, int>;

int main()
{
    (void) S_int{1, 2};
}

Metadata

Metadata

Assignees

Labels

accepts-invalidc++17clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contribute

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions