[clang] [clang][bytecode] Don't diagnose defined functions that will have a body (PR #165002)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 24 08:57:00 PDT 2025
tbaederr wrote:
This breaks `SemaTemplate/instantiate-self.cpp`, in particular
```c++
template<typename T> constexpr T f(T);
template<typename T> constexpr T g(T t) {
// FIXME: It'd be nice to say that the function is currently being defined, rather than being undefined.
typedef int arr[f(T())]; // expected-error {{variable length array}} expected-note {{undefined function 'f<int>'}}
return t;
}
template<typename T> constexpr T f(T t) { // expected-note {{declared here}}
typedef int arr[g(T())]; // expected-error {{zero size array}} expected-note {{instantiation of}}
return t;
}
int n = f(0); // expected-note 2{{instantiation of}}
```
https://github.com/llvm/llvm-project/pull/165002
More information about the cfe-commits
mailing list