Comments (3)
If we look at the AST of waldo
, we'll see the call expression find_if
is modeled as an UnresolvedLookupExpr
, and thus the type of such is dependent.
I think there's improvement room regarding the clang side, such as we can eagerly perform the lookup of call expressions with non-dependent arguments, and thereby, the result type would be non-dependent at the time clangd consumes the AST. But I could also envision some earlier diagnostics brought over by such drastic changes might break some existing codebases.
We can definitely invent some heuristics at clangd side - I presume that's basically a duplicate of a somewhat CXXNameLookup
.
from clangd.
Change the second argument to
find_if()
to not be a lambda
Fun enough that the lambda expression plays the trick here - probably we are somehow depending on the lambda's dependency?
from clangd.
While I haven't checked the details, my guess is that, since lambdas are modelled as local classes, and the local class is declared inside the function's DeclContext, it therefore becomes a different type in every instantiation of the function template.
If that's the case, there might be an opportunity to optimize the frontend itself here, to avoid instantiating find_if
separately for each instantiation of waldo
.
from clangd.
Related Issues (20)
- Clangd crashes while parsing invalid code HOT 3
- Weekly snapshot releases are not being published again, since 20240421
- Don`t work in vs code with qt6 HOT 1
- clangd-indexer aborts while creating index file HOT 2
- Add header-insertion: never option to .clangd config HOT 3
- Template arguments in placeholder's type-constraint are not selected correctly. HOT 2
- clangd do not recognise headers located in pch HOT 2
- Call hierarchy points to an empty line HOT 3
- Issue with Clang Tools on Windows using Cygwin64 for a C++17 project with <mutex> HOT 8
- Unused header warning for placement new
- headers from pch are not recognized inside project HOT 8
- clangd does not detect C++17 or newer features when compiled with CMake 3.28 + Ninja on Windows HOT 8
- omit `self` when clangd compltes member function with explicit self HOT 4
- Include Cleaner fails for symbols forward-declared and aliased
- Include cleaner recommends removing includes needed for casts to related types
- Unsupported argument 'cortex-a76.cortex-a55' to option '-mcpu='clang(drv_unsupported_option_argument) HOT 1
- clangd find references, refactor rename works only with opened files HOT 6
- Clangd throws error on working code with CUDA HOT 6
- Include Cleaner doesn't include headers needed by default template arguments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clangd.