@@ -193,26 +193,53 @@ abstract class Declaration extends Locatable, @declaration {
193193
194194 /**
195195 * Gets a template argument used to instantiate this declaration from a template.
196- * When called on a template, this will return a template parameter.
196+ * When called on a template, this will return a template parameter type for
197+ * both typed and non-typed parameters.
197198 */
198199 final Type getATemplateArgument ( ) { result = getTemplateArgument ( _) }
199200
200201 /**
201202 * Gets a template argument used to instantiate this declaration from a template.
202- * When called on a template, this will return a template parameter value.
203+ * When called on a template, this will return a non-typed template
204+ * parameter value.
203205 */
204206 final Expr getATemplateArgumentValue ( ) { result = getTemplateArgumentValue ( _) }
205207
206208 /**
207209 * Gets the `i`th template argument used to instantiate this declaration from a
208- * template. When called on a template, this will return the `i`th template parameter.
210+ * template. When called on a template, this will return the `i`th template
211+ * parameter's type.
212+ *
213+ * For example:
214+ *
215+ * `template<typename T, T X> class Foo;`
216+ *
217+ * Will have `getTemplateArgument(0)` return `T`, and
218+ * `getTemplateArgument(1)` return `T`.
219+ *
220+ * `Foo<int, 1> bar;
221+ *
222+ * Will have `getTemplateArgument())` return `int`, and
223+ * `getTemplateArgument(1)` return `int`.
209224 */
210225 Type getTemplateArgument ( int index ) { none ( ) }
211226
212227 /**
213228 * Gets the `i`th template argument value used to instantiate this declaration
214229 * from a template. When called on a template, this will return the `i`th template
215230 * parameter value if it exists.
231+ *
232+ * For example:
233+ *
234+ * `template<typename T, T X> class Foo;`
235+ *
236+ * Will have `getTemplateArgumentValue(1)` return `X`, and no result for
237+ * `getTemplateArgumentValue(0)`.
238+ *
239+ * `Foo<int, 10> bar;
240+ *
241+ * Will have `getTemplateArgumentValue(1)` return `10`, and no result for
242+ * `getTemplateArgumentValue(0)`.
216243 */
217244 Expr getTemplateArgumentValue ( int index ) { none ( ) }
218245
0 commit comments