]> granicus.if.org Git - clang/commitdiff
Fix the source range for ObjCInterfaces that are forward decls.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 31 Oct 2011 07:20:23 +0000 (07:20 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 31 Oct 2011 07:20:23 +0000 (07:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143343 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h

index 136acf377f96aa97f4bd53be1093d5dffda74dae..b717af0d01b699d137bc006085ac429f0a16d460 100644 (file)
@@ -592,6 +592,12 @@ public:
                                    SourceLocation ClassLoc = SourceLocation(),
                                    bool ForwardDecl = false,
                                    bool isInternal = false);
+
+  virtual SourceRange getSourceRange() const {
+    if (isForwardDecl())
+      return SourceRange(getAtStartLoc(), getLocation());
+    return ObjCContainerDecl::getSourceRange();
+  }
   
   /// \brief Indicate that this Objective-C class is complete, but that
   /// the external AST source will be responsible for filling in its contents