IntelliSense reports an error on a valid deduction guide (error: the return type must directly designate a specialization of the associated class template)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c, typescript
- Lĩnh vực
- devtools
Hướng nghiên cứu
The report provides a minimal C++ reproduction with deduction guides and IntelliSense diagnostics, but does not name the parser implementation or a repository test. Start by locating the IntelliSense parsing and deduction-guide tests in vscode-cpptools, then run the relevant tests against the supplied example. Done when IntelliSense accepts the valid guide without the reported error or redeclaration diagnostic.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
- 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 and Steps to Reproduce
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 >
struct slice
{
static constexpr size_t index = i, size = s;
};
template<>
struct slice< std::dynamic_extent, std::dynamic_extent >
{
size_t index = 0, size = 0;
constexpr slice() noexcept = default;
constexpr slice( 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{}; // OK
auto s1 = slice{ 1, 2 }; // error
auto s2 = slice< 3, 4 >{}; // OK
auto s3 = const_slice< 5, 6 >; // OK
slice s5 = { 2, 4 }; // error
slice s6; // OK
size_t n = 1;
auto s7 = slice{ n, 3 }; // error
int main() {}
Update: switching to 1.35.3 only partly fixed the problem. Now the error occurs at these lines:
slice() -> slice<>; // redeclaration of deduction guide "()->slice<18446744073709551615UL, 18446744073709551615UL>" (previous declaration at line 30)
slice( size_t, size_t ) -> slice<>; // rredeclaration of deduction guide "(size_t, size_t)->slice<18446744073709551615UL, 18446744073709551615UL>" (previous declaration at line 32)
Configuration and Logs
-------- Diagnostics - 09/10/2026, 11:09:54
Version: 1.35.3
Current Configuration:
{
"name": "Mac",
"includePath": [
"/Users/dom/Repositories/Foo/**"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "gnu17",
"intelliSenseMode": "macos-clang-arm64",
"compilerPathInCppPropertiesJson": "/usr/bin/clang",
"cppStandard": "c++26",
"intelliSenseModeIsExplicit": false,
"cStandardIsExplicit": false,
"cppStandardIsExplicit": true,
"mergeConfigurations": false,
"recursiveIncludes": {},
"recursiveIncludesPriorityIsExplicit": false,
"recursiveIncludesOrderIsExplicit": false,
"compilerPathIsExplicit": false,
"browse": {
"limitSymbolsToIncludedHeaders": true
}
}
Modified Settings:
{
"C_Cpp.default.cppStandard": "c++26",
"C_Cpp.copilotHover": "disabled"
}
Additional Tracked Settings:
{
"editorTabSize": 4,
"editorInsertSpaces": true,
"editorAutoClosingBrackets": "languageDefined",
"filesEncoding": "utf8",
"filesAssociations": {},
"filesExclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.jj": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"filesAutoSaveAfterDelay": true,
"editorInlayHintsEnabled": true,
"editorParameterHintsEnabled": true,
"searchExclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true
},
"workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.35.3.0
Current database path: /Users/dom/Library/Caches/vscode-cpptools/3e0375b3f54b329c80d0cabaf418165d/.browse.VC.db
Translation Unit Mappings:
[ /Users/dom/Repositories/Foo/Projects/Engine/Source/Engine.cpp - source TU]:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/include/__stddef_max_align_t.h
/Users/dom/Repositories/Foo/Projects/Engine/Source/Foundation/Math/Matrix/MatrixForward.hpp
/Users/dom/Repositories/Foo/Projects/Engine/Source/Foundation/Math/Matrix/Slice.hpp
/Users/dom/Repositories/Foo/Projects/Engine/Source/Foundation/Math/Matrix/StaticMatrix.hpp
/Users/dom/Repositories/Foo/Projects/Engine/Source/Foundation/Math/Vector/VectorForward.hpp
Translation Unit Configurations:
[ /Users/dom/Repositories/Foo/Projects/Engine/Source/Engine.cpp ]
Process ID: 82533
Memory Usage: 447 MB
Compiler Path: /usr/bin/clang
Language: C++
Include Paths:
system include: /usr/local/include
system include: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
system include: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/include
system include: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
system include: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
system framework search path (default): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
system framework search path (default): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks
include (recursive): /Users/dom/Repositories/Foo
Standard Version: c++26
IntelliSense Mode: macos-clang-arm64
Other Flags:
--clang
--clang_version=210106
Total Memory Usage: 447 MB
Other Extensions
No response
Additional context
No response
- Ngôn ngữ chính
- TypeScript
- Star
- 6.2k
- Fork
- 1.7k
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 41
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/vscode-cpptools
-
Make the new type size & alignment hover hints hideableCó thể đã có người làm @Colengms đã nhận 1 ngày trước. Đang mởFeature Request Feature: Hover (Quick Info) Language Service
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
microsoft/vscode-cpptools#14820 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Language Service more info needed
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/vscode-cpptools#14819 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
microsoft/vscode-cpptools#14817 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Language Service more info needed
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
microsoft/vscode-cpptools#14816 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
microsoft/vscode-cpptools#14815 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/vscode-cpptools
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
vectorize-io/hindsight#5457 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
beginner friendly community contributions-welcome good first issue hacktoberfest help wanted testing up-for-grabs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
lukilabs/beautiful-mermaid#160 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
rescript-lang/rescript-lang.org#1420 ·
Maintainer thường phản hồi trong vòng 2 ngày