aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/Type.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-04-13 21:07:44 +0000
committerDouglas Gregor <dgregor@apple.com>2008-04-13 21:07:44 +0000
commit2ce52f3fb95bf544db6bd3d91a72bce7d9cceb6c (patch)
tree733d57759dcbbc4c20909f051db94a367d6914f8 /include/clang/AST/Type.h
parentd98d975ccdce7ec442ac26f682404cb71df40ff8 (diff)
Introduce support for finding class and enum names via ordinary name lookup in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/Type.h')
-rw-r--r--include/clang/AST/Type.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 5d36b759a3..8b5ed4ce63 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -994,10 +994,11 @@ public:
class TagType : public Type {
TagDecl *decl;
+
+protected:
TagType(TagDecl *D, QualType can) : Type(Tagged, can), decl(D) {}
- friend class ASTContext; // ASTContext creates these.
-public:
-
+
+public:
TagDecl *getDecl() const { return decl; }
virtual void getAsStringInternal(std::string &InnerString) const;
@@ -1014,7 +1015,8 @@ protected:
/// RecordType - This is a helper class that allows the use of isa/cast/dyncast
/// to detect TagType objects of structs/unions/classes.
class RecordType : public TagType {
- RecordType(); // DO NOT IMPLEMENT
+ explicit RecordType(RecordDecl *D) : TagType(cast<TagDecl>(D), QualType()) { }
+ friend class ASTContext; // ASTContext creates these.
public:
RecordDecl *getDecl() const {
@@ -1040,7 +1042,8 @@ public:
/// EnumType - This is a helper class that allows the use of isa/cast/dyncast
/// to detect TagType objects of enums.
class EnumType : public TagType {
- EnumType(); // DO NOT IMPLEMENT
+ explicit EnumType(EnumDecl *D) : TagType(cast<TagDecl>(D), QualType()) { }
+ friend class ASTContext; // ASTContext creates these.
public:
EnumDecl *getDecl() const {