Yi Kong | 7bf2a68 | 2019-04-18 17:30:49 -0700 | [diff] [blame] | 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. |
| 25 | TNK_Function_template, |
| 26 | /// The name refers to a template whose specialization produces a |
| 27 | /// type. The template itself could be a class template, template |
| 28 | /// template parameter, or template alias. |
| 29 | TNK_Type_template, |
| 30 | /// The name refers to a variable template whose specialization produces a |
| 31 | /// variable. |
| 32 | TNK_Var_template, |
| 33 | /// The name refers to a dependent template name: |
| 34 | /// \code |
| 35 | /// template<typename MetaFun, typename T1, typename T2> struct apply2 { |
| 36 | /// typedef typename MetaFun::template apply<T1, T2>::type type; |
| 37 | /// }; |
| 38 | /// \endcode |
| 39 | /// |
| 40 | /// Here, "apply" is a dependent template name within the typename |
| 41 | /// specifier in the typedef. "apply" is a nested template, and |
| 42 | /// whether the template name is assumed to refer to a type template or a |
| 43 | /// function template depends on the context in which the template |
| 44 | /// name occurs. |
| 45 | TNK_Dependent_template_name |
| 46 | }; |
| 47 | |
| 48 | } |
| 49 | #endif |
| 50 | |
| 51 | |