Bug 114378 - GCC fails on selecting a partial template specialization.
Summary: GCC fails on selecting a partial template specialization.
Status: RESOLVED DUPLICATE of bug 60679
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-18 13:28 UTC by Haojian Wu
Modified: 2024-03-18 13:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Haojian Wu 2024-03-18 13:28:54 UTC
GCC (trunk) behaves differently for the following code where the arguments of a template A can be deducible from a type. https://godbolt.org/z/3bxW8W9To


```
#include <array>

template <int N>
using A = std::array<int, N>;

// Ensures a specialization of A is deduced, from https://eel.is/c++draft/over.match.class.deduct#6
template <class> class AA;
template <int N> class AA<A<N>> {};
template <class T> concept deduces_A = requires { sizeof(AA<T>);} ;

static_assert(deduces_A<std::array<int, 3>>); // fails on gcc, true on clang and msvc
```
Comment 1 Patrick Palka 2024-03-18 13:38:32 UTC
IIUC this is CWG1647 / PR60679.

It works if we give 'N' type std::size_t instead of so that there's no implicit integral conversion going on.

*** This bug has been marked as a duplicate of bug 60679 ***