]> granicus.if.org Git - clang/commitdiff
Add some comments to the virtual work. Thanks to Doug Gregor for the review.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Fri, 9 Jan 2009 22:29:03 +0000 (22:29 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Fri, 9 Jan 2009 22:29:03 +0000 (22:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62012 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
lib/Sema/SemaDeclCXX.cpp

index 1d09ea71103d0c363d9c0f7461123032364862d0..e0b0b169a2ac743e56bf34ec6e36724c495e4914 100644 (file)
@@ -696,9 +696,13 @@ public:
 
   void setBody(Stmt *B) { Body = B; }
 
+  /// Whether this function is virtual, either by explicit marking, or by
+  /// overriding a virtual function. Only valid on C++ member functions.
   bool isVirtual() { return IsVirtual; }
   void setVirtual() { IsVirtual = true; }
 
+  /// Whether this virtual function is pure, i.e. makes the containing class
+  /// abstract.
   bool isPure() { return IsPure; }
   void setPure() { IsPure = true; }
 
index ba4a47d63ec9e02f8b25e6f61a0547d74cc30ce5..dcd378936a1434e15616fd027ab8172846519663 100644 (file)
@@ -615,6 +615,9 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
     } else {
       // not static member. perhaps virtual function?
       if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(Member)) {
+        // With declarators parsed the way they are, the parser cannot
+        // distinguish between a normal initializer and a pure-specifier.
+        // Thus this grotesque test.
         IntegerLiteral *IL;
         if ((IL = dyn_cast<IntegerLiteral>(Init)) && IL->getValue() == 0 &&
             Context.getCanonicalType(IL->getType()) == Context.IntTy) {