You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 173bbee
Browse filesBrowse the repository at this point in the historyBrowse files
Convert late instantiated methods on Ptr<Self> instead of self (#334)
After #333, late instantiated methods from templates were not added in
the `impl X for Ptr<Self>` block. For exmaple:
```cpp
// 2 methods, each instantiated in separate TUs. Second TU got it wrong
template <typename T>
struct S {
T x = 0;
// visited in first TU: correctly added in `trait SImpl` and `impl SImpl for Ptr<Self>`
void set(T v) { x = v; }
// visited in the second TU: not added in `trait SImpl` at all and incorrectly added
// in `impl S` instead of `impl SImpl for Ptr<Self>`
T get() { return x; }
};
```
This PR solves it by also deferring trait blocks at the end of the file
and adding late instantiated methods in both `trait SImpl` and `impl
SImpl for Ptr<Self>`.
0 commit comments