benedekaibas wrote:

The next case to handle is when the method is annotated and the return binds to 
the receiver:

```
struct A {};
struct X {
   A a;
   A& getA() [[clang::lifetimebound]] { return a; }
};
```

This comes from the discussion on the forum. When there is no parameter and 
method itself has the lifetime annotation is currently not covered in my 
implementation. In this case there will be no `ParmVarDecl` since there is not 
parameter, so it needs a different handling. I have dumped the AST just now and 
it shows:

`-CXXMethodDecl <line:4:5, col:52> col:8 getA 'A &() 
[[clang::lifetimebound]]':'A &()' implicit-inline external-linkage`



https://github.com/llvm/llvm-project/pull/200145
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to