Open Disservin opened 10 months ago
@Disservin I've filed a VS bug at https://developercommunity.visualstudio.com/t/C-IntelliSense-gives-the-incorrect-err/10551604 , but it might be a "by design" issue due to implementation details/limitations with our parsing algorithm.
A potential workaround would be to use something like
class Test {};
namespace {
::Test Test;
}
Alright, thank you already in advance!
@sean-mcmanus unfortunately that workaround doesnt really work
class Test {
public:
void foo(){}
};
namespace {
::Test Test;
}
int main() {
Test.foo();
}
g++:
g++ .\vsc-issue.cpp
.\vsc-issue.cpp: In function 'int main()':
.\vsc-issue.cpp:10:14: error: reference to 'Test' is ambiguous
10 | int main() { Test.foo(); }
| ^~~~
.\vsc-issue.cpp:7:8: note: candidates are: 'Test {anonymous}::Test'
7 | ::Test Test;
| ^~~~
.\vsc-issue.cpp:1:7: note: 'class Test'
1 | class Test {
Environment
Version: 1.85.1 (user setup) Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2 Date: 2023-12-13T09:49:37.021Z Electron: 25.9.7 ElectronBuildId: 25551756 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.22621
Bug Summary and Steps to Reproduce
Bug Summary: Intellisense complains about type.
Steps to reproduce:
Error:
variable "Test" is not a type nameC/C++(757)
Expected behavior: No error from intellisense
Configuration and Logs
Other Extensions
No response
Additional context
No response