You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deduction guides do not work through alias templates #14794
In testing, a variadic deduction guide and the use of pack indexing seemed necessary to trigger the bug. Although I'm not certain, it could indicate a problem with pack indexing somehow blocking template deduction.
maf (@marralesfios) It would help if you could mention if this is a regression compared to 1.35.1 or 1.34.4...although I can find this out myself later.
I might have similar problem. I didn't want to create a new issue, so i'm posting the error here:
OS: macOS 27.0.1 (Apple Silicon)
VS Code version: 1.140.0
C/C++ extension version: 1.34.4 (darwin-arm64)
Compilers that accept the code: Apple clang 21.0.0 (clang-2100.3.34.2), GCC 16.2.0 (-std=c++23 -Wall -Wextra -pedantic)
Bug Summary:
IntelliSense reports an error on a valid deduction guide whose return type is an explicit specialization of the class template. Clang and GCC compile and run the code without warnings.
Steps to reproduce:
Set the "cppStandard": "gnu++20".
#include<cstddef>
#include<span>using std::size_t;
template< size_t i = std::dynamic_extent, size_t s = std::dynamic_extent >
structslice
{
staticconstexprsize_t index = i, size = s;
};
template<>
structslice< std::dynamic_extent, std::dynamic_extent >
{
size_t index = 0, size = 0;
constexprslice() noexcept = default;
constexprslice( size_t i, size_t s ) noexcept : index( i ), size( s ) {}
};
slice() -> slice<>;
slice( size_t, size_t ) -> slice<>; // error: "the return type must directly designate a specialization of the associated class template"template< size_t i, size_t s >
constexpr slice< i, s > const_slice;
auto s0 = slice{}; // OKauto s1 = slice{ 1, 2 }; // errorauto s2 = slice< 3, 4 >{}; // OKauto s3 = const_slice< 5, 6 >; // OK
slice s5 = { 2, 4 }; // error
slice s6; // OKsize_t n = 1;
auto s7 = slice{ n, 3 }; // errorintmain() {}
Dominik Deák (@DominikDeak) I can reproduce your problem. Since it seems unrelated to alias templates (as well as the error message being different), you can probably report this bug separately
Activity
sean-mcmanus commentedon Sep 23, 2026
maf (@marralesfios) It would help if you could mention if this is a regression compared to 1.35.1 or 1.34.4...although I can find this out myself later.
marralesfios commentedon Sep 25, 2026
Sean McManus (@sean-mcmanus) Seems to be buggy in both 1.35.1 and 1.34.4
DominikDeak commentedon Oct 8, 2026
I might have similar problem. I didn't want to create a new issue, so i'm posting the error here:
-std=c++23 -Wall -Wextra -pedantic)Bug Summary:
IntelliSense reports an error on a valid deduction guide whose return type is an explicit specialization of the class template. Clang and GCC compile and run the code without warnings.
Steps to reproduce:
Set the "cppStandard": "gnu++20".
DominikDeak commentedon Oct 8, 2026
Update: switching to 1.35.3 only partly fixed the problem. Now the error occurs at these lines:
marralesfios commentedon Oct 8, 2026
Dominik Deák (@DominikDeak) I can reproduce your problem. Since it seems unrelated to alias templates (as well as the error message being different), you can probably report this bug separately
DominikDeak commentedon Oct 9, 2026
Thanks, separate bug report here:
#14824