Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][NFC] Add documentation for CastExpr::path(). #85623

Merged
merged 3 commits into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions clang/include/clang/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3561,6 +3561,18 @@ class CastExpr : public Expr {
path_const_iterator path_begin() const { return path_buffer(); }
path_const_iterator path_end() const { return path_buffer() + path_size(); }

/// Path through the class hierarchy taken by casts between base and derived
/// classes (see implementation of `CastConsistency()` for a full list of
/// cast kinds that have a path).
///
/// For each derived-to-base edge in the path, the path contains a
/// `CXXBaseSpecifier` for the base class of that edge; the entries are
/// ordered from derived class to base class.
///
/// For example, given classes `Base`, `Intermediate : public Base` and
/// `Derived : public Intermediate`, the path for a cast from `Derived *` to
/// `Base *` contains two entries: One for `Intermediate`, and one for `Base`,
/// in that order.
llvm::iterator_range<path_iterator> path() {
return llvm::make_range(path_begin(), path_end());
}
Expand Down
Loading