Quuxplusone added inline comments.

================
Comment at: clang/include/clang/Basic/AttrDocs.td:4087-4088
 
-Marking virtual functions as ``not_tail_called`` is an error:
+Marking virtual functions as ``not_tail_called`` will not have effect on the
+overriding functions of derived classes:
 
----------------
aaron.ballman wrote:
> 
/will not have effect/will have no effect/
However, this phrasing is easy to interpret the wrong way around: actually 
marking a (base-class) virtual function //will// affect overriding functions in 
derived classes! You meant that marking the //overrider// wouldn't 
retroactively affect the //overridden// function from the base class.
I think the correct explanation would be more like this:

    Generally, marking an overriding virtual function as ``not_tail_called`` is
    not useful, because this attribute is a property of the static type. Calls
    made through a pointer or reference to the base class type will respect
    the ``no_tail_called`` attribute of the base class's member function,
    regardless of the runtime destination of the call.

I think it'd also be correct and helpful to add:

    Similarly, calls made through a function pointer will respect the
    ``no_tail_called`` attribute of the function pointer, not of its
    runtime destination.

(I admit this is mildly redundant with the `foo2` example above.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96832

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

Reply via email to