From d874def0f9003cb8582e97452345b2a3a4a18b6d Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 19 Mar 2009 18:33:54 +0000 Subject: [PATCH] Add a clarifying comment about HasPrototype's computation git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67316 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDecl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a50381123c..99ea707760 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1864,6 +1864,12 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, 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) || -- 2.40.0