Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

deduction guides do not work through alias templates

未关闭
#14,794 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@sean-mcmanus 已经在做这个了。

开始于 2026年9月23日。

评估

这个 Issue 还没有评估数据。

描述

bug Language Service parser
Environment
  • OS and Version: x64, Arch Linux (7.2.6.arch2-1)
  • VS Code Version: 1.138.0 commit: 7debcd0e2acdea1c52de81bf9ee1620444407dda
  • C/C++ Extension Version: 1.35.2 pre-release
  • If using SSH remote, specify OS of remote machine: N/A
Bug Summary and Steps to Reproduce

Bug Summary: Intellisense fails to perform CTAD in the following code, when an alias template for Foo is created:

template<typename T>
struct Foo{
    Foo(auto...){}
};
template<typename ...T>
Foo(T...) -> Foo<T...[0uz]>;

template<typename T>
using Foo2 = Foo<T>;

int main(){
    Foo x{3.1f};  // OK
    Foo2 y{3.1f}; // Not OK??
    return 0;
}
Image

GCC accepts this code.

Steps to reproduce:

  1. Create a new folder, open it as a workspace, and copy test.cpp into it
  2. Open file
  3. See error

Expected behavior:
Intellisense correctly performs CTAD and does not raise an error.

Configuration and Logs

c_cpp_properties.json: (None used)

Log Diagnostics output

Language server logging

Other Extensions

No response

Additional context

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.

主要语言
TypeScript
星标
6.2k
派生
1.7k
平均合并
1 天 4 小时
30 天内合并 PR
58

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-cpptools 的其他 Issue

查看 microsoft/vscode-cpptools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。