]> granicus.if.org Git - clang/commitdiff
Publicize getSigilLoc / setSigilLoc for better metaprogramming.
authorJohn McCall <rjmccall@apple.com>
Wed, 21 Oct 2009 00:21:09 +0000 (00:21 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 21 Oct 2009 00:21:09 +0000 (00:21 +0000)
Fix the ReferenceTypeLoc hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84714 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/TypeLoc.h

index 05eed0a18707109d06dcb8e1dd1f5356a5aa256e..b980f2bd0ff8e586cd1664c8f0d5ee0beebcc2df 100644 (file)
@@ -467,7 +467,7 @@ struct PointerLikeLocInfo {
 template <class Derived, class TypeClass, class LocalData = PointerLikeLocInfo>
 class PointerLikeTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, Derived,
                                                   TypeClass, LocalData> {
-protected:
+public:  
   SourceLocation getSigilLoc() const {
     return this->getLocalData()->StarLoc;
   }
@@ -475,7 +475,6 @@ protected:
     this->getLocalData()->StarLoc = Loc;
   }
 
-public:  
   TypeLoc getPointeeLoc() const {
     return this->getInnerTypeLoc();
   }
@@ -537,8 +536,10 @@ class ReferenceTypeLoc : public PointerLikeTypeLoc<ReferenceTypeLoc,
                                                    ReferenceType> {
 };
 
-class LValueReferenceTypeLoc : public PointerLikeTypeLoc<LValueReferenceTypeLoc,
-                                                         LValueReferenceType> {
+class LValueReferenceTypeLoc :
+    public InheritingConcreteTypeLoc<ReferenceTypeLoc,
+                                     LValueReferenceTypeLoc,
+                                     LValueReferenceType> {
 public:
   SourceLocation getAmpLoc() const {
     return getSigilLoc();
@@ -548,8 +549,10 @@ public:
   }
 };
 
-class RValueReferenceTypeLoc : public PointerLikeTypeLoc<RValueReferenceTypeLoc,
-                                                         RValueReferenceType> {
+class RValueReferenceTypeLoc :
+    public InheritingConcreteTypeLoc<ReferenceTypeLoc,
+                                     RValueReferenceTypeLoc,
+                                     RValueReferenceType> {
 public:
   SourceLocation getAmpAmpLoc() const {
     return getSigilLoc();