From 8d22eb87f05a253e66ccce498cc19b9a3374ac10 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 15 Jul 2019 10:45:00 +0100 Subject: [PATCH] CPP: Improvements to qldoc. --- cpp/ql/src/semmle/code/cpp/Class.qll | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/cpp/ql/src/semmle/code/cpp/Class.qll b/cpp/ql/src/semmle/code/cpp/Class.qll index 2724fcefa5f..6afdb2109d6 100644 --- a/cpp/ql/src/semmle/code/cpp/Class.qll +++ b/cpp/ql/src/semmle/code/cpp/Class.qll @@ -905,8 +905,8 @@ class LocalClass extends Class { } /** - * A nested class [4140 9.7]. For example the struct `PairT` in the following - * code is a nested class: + * A nested class, that is, a class declared within another class. For example + * the struct `PairT` in the following code is a nested class: * ``` * template * class MyTemplateClass { @@ -958,6 +958,9 @@ class AbstractClass extends Class { * ... * }; * ``` + * Note that this does not include template instantiations, and full + * specializations. See `ClassTemplateInstantiation` and + * `FullClassTemplateSpecialization`. */ class TemplateClass extends Class { TemplateClass() { usertypes(underlyingElement(this),_,6) } @@ -994,7 +997,16 @@ class ClassTemplateInstantiation extends Class { /** * Gets the class template from which this instantiation was instantiated. * - * For example: For `std::vector`, the result is `std::vector`. + * For example for `MyTemplateClass` in the following code, the result is + * `MyTemplateClass`: + * ``` + * template + * class MyTemplateClass { + * ... + * }; + * + * MyTemplateClass instance; + * ``` */ TemplateClass getTemplate() { result = tc @@ -1003,7 +1015,8 @@ class ClassTemplateInstantiation extends Class { /** * A specialization of a class template (this may be a full or partial template - * specialization). + * specialization - see `FullClassTemplateSpecialization` and + * `PartialClassTemplateSpecialization`). */ abstract class ClassTemplateSpecialization extends Class { /**