hokein added inline comments.

================
Comment at: clang-tools-extra/clangd/unittests/tweaks/ExpandAutoTypeTests.cpp:88
+      R"cpp(template <typename T> concept C = true;
+^C a^uto abc();
+    )cpp");
----------------
sammccall wrote:
> This shouldn't be unavailable because it's constrained, it should be 
> unavailable because it's not deduced.
> 
> Does this case pass or fail today?
> 
> If the issue with constrained auto is syntactic, can you add a deductible 
> test case?
> it should be unavailable because it's not deduced.

This is ideal, but not the behavior today -- the tweak is available but being 
failed to apply as we don't check the auto is deduced during prepare stage (it 
is expensive, requiring an AST traversal). 

For deducible cases, we replace the `C auto` with the actual type, e.g.
```
template <typename T> concept C = true;
C auto var = 123;  // => int var = 123;
```
I don't think this is an expected behavior. Given the deductible & 
nondeductible cases, it seems like an improvement to disable the tweak for 
constrained auto.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117463/new/

https://reviews.llvm.org/D117463

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to