[cfe-commits] r67316 - /cfe/trunk/lib/Sema/SemaDecl.cpp

Douglas Gregor dgregor at apple.com
Thu Mar 19 11:33:54 PDT 2009


Author: dgregor
Date: Thu Mar 19 13:33:54 2009
New Revision: 67316

URL: http://llvm.org/viewvc/llvm-project?rev=67316&view=rev
Log:
Add a clarifying comment about HasPrototype's computation

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=67316&r1=67315&r2=67316&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Mar 19 13:33:54 2009
@@ -1864,6 +1864,12 @@
 
     isVirtualOkay = (SC != FunctionDecl::Static);
   } else {
+    // Determine whether the function was written with a
+    // prototype. This true when:
+    //   - we're in C++ (where every function has a prototype),
+    //   - there is a prototype in the declarator, or
+    //   - the type R of the function is some kind of typedef or other reference
+    //     to a type name (which eventually refers to a function type).
     bool HasPrototype = 
        getLangOptions().CPlusPlus ||
        (D.getNumTypeObjects() && D.getTypeObject(0).Fun.hasPrototype) ||





More information about the cfe-commits mailing list