1 | //===--- TemplateKinds.h - Enum values for C++ Template Kinds ---*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | /// |
9 | /// \file |
10 | /// Defines the clang::TemplateNameKind enum. |
11 | /// |
12 | //===----------------------------------------------------------------------===// |
13 | #ifndef LLVM_CLANG_BASIC_TEMPLATEKINDS_H |
14 | #define LLVM_CLANG_BASIC_TEMPLATEKINDS_H |
15 | |
16 | namespace clang { |
17 | |
18 | /// Specifies the kind of template name that an identifier refers to. |
19 | /// Be careful when changing this: this enumeration is used in diagnostics. |
20 | enum TemplateNameKind { |
21 | /// The name does not refer to a template. |
22 | TNK_Non_template = 0, |
23 | /// The name refers to a function template or a set of overloaded |
24 | /// functions that includes at least one function template, or (in C++20) |
25 | /// refers to a set of non-template functions but is followed by a '<'. |
26 | TNK_Function_template, |
27 | /// The name refers to a template whose specialization produces a |
28 | /// type. The template itself could be a class template, template |
29 | /// template parameter, or template alias. |
30 | TNK_Type_template, |
31 | /// The name refers to a variable template whose specialization produces a |
32 | /// variable. |
33 | TNK_Var_template, |
34 | /// The name refers to a dependent template name: |
35 | /// \code |
36 | /// template<typename MetaFun, typename T1, typename T2> struct apply2 { |
37 | /// typedef typename MetaFun::template apply<T1, T2>::type type; |
38 | /// }; |
39 | /// \endcode |
40 | /// |
41 | /// Here, "apply" is a dependent template name within the typename |
42 | /// specifier in the typedef. "apply" is a nested template, and |
43 | /// whether the template name is assumed to refer to a type template or a |
44 | /// function template depends on the context in which the template |
45 | /// name occurs. |
46 | TNK_Dependent_template_name, |
47 | /// Lookup for the name failed, but we're assuming it was a template name |
48 | /// anyway. In C++20, this is mandatory in order to parse ADL-only function |
49 | /// template specialization calls. |
50 | TNK_Undeclared_template, |
51 | /// The name refers to a concept. |
52 | TNK_Concept_template, |
53 | }; |
54 | |
55 | } |
56 | #endif |
57 | |