[clang] [clangd][Parser][Sema] Fix TemplateIdAnnotation UAF with template-id … (PR #196788)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Sun May 10 05:17:57 PDT 2026
================
@@ -40,3 +40,9 @@ struct U {
void i(int x = ) {} // expected-error{{expected expression}}
typedef int *fp(int x = ); // expected-error{{default arguments can only be specified for parameters in a function declaration}}
};
+
+namespace {
+void f<>(int = []{;}) {} // expected-error{{no viable conversion from}} \
----------------
zyn0217 wrote:
```suggestion
namespace GH196725 {
void f<>(int = []{;}) {} // expected-error{{no viable conversion from}} \
```
Hum, can you please check if there's a bug with a valid example? If so I think we'd better add the valid example to the test for clarity.
```cpp
template <class>
void f(int = []{;}) {}
```
https://github.com/llvm/llvm-project/pull/196788
More information about the cfe-commits
mailing list