@@ -210,9 +210,19 @@ abstract class Declaration extends Locatable, @declaration {
210
210
}
211
211
212
212
/**
213
- * A C/C++ declaration entry. See the comment above `Declaration` for an
214
- * explanation of the relationship between `Declaration` and
215
- * `DeclarationEntry`.
213
+ * A C/C++ declaration entry. For example the following code contains five
214
+ * declaration entries:
215
+ * ```
216
+ * extern int myGlobal;
217
+ * int myVariable;
218
+ * typedef char MyChar;
219
+ * void myFunction();
220
+ * void myFunction() {
221
+ * // ...
222
+ * }
223
+ * ```
224
+ * See the comment above `Declaration` for an explanation of the relationship
225
+ * between `Declaration` and `DeclarationEntry`.
216
226
*/
217
227
abstract class DeclarationEntry extends Locatable {
218
228
/** Gets a specifier associated with this declaration entry. */
@@ -285,8 +295,19 @@ abstract class DeclarationEntry extends Locatable {
285
295
* A declaration that can potentially have more C++ access rights than its
286
296
* enclosing element. This comprises `Class` (they have access to their own
287
297
* private members) along with other `UserType`s and `Function` (they can be
288
- * the target of `friend` declarations).
289
- *
298
+ * the target of `friend` declarations). For example `MyClass` and
299
+ * `myFunction` in the following code:
300
+ * ```
301
+ * class MyClass
302
+ * {
303
+ * public:
304
+ * ...
305
+ * };
306
+ *
307
+ * void myFunction() {
308
+ * // ...
309
+ * }
310
+ * ```
290
311
* In the C++ standard (N4140 11.2), rules for access control revolve around
291
312
* the informal phrase "_R_ occurs in a member or friend of class C", where
292
313
* `AccessHolder` corresponds to this _R_.
@@ -420,8 +441,19 @@ abstract class AccessHolder extends Declaration {
420
441
/**
421
442
* A declaration that very likely has more C++ access rights than its
422
443
* enclosing element. This comprises `Class` (they have access to their own
423
- * private members) along with any target of a `friend` declaration.
424
- *
444
+ * private members) along with any target of a `friend` declaration. For
445
+ * example `MyClass` and `friendFunction` in the following code:
446
+ * ```
447
+ * class MyClass
448
+ * {
449
+ * public:
450
+ * friend void friendFunction();
451
+ * };
452
+ *
453
+ * void friendFunction() {
454
+ * // ...
455
+ * }
456
+ * ```
425
457
* Most access rights are computed for `DirectAccessHolder` instead of
426
458
* `AccessHolder` -- that's more efficient because there are fewer
427
459
* `DirectAccessHolder`s. If a `DirectAccessHolder` contains an `AccessHolder`,
0 commit comments