diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-03-19 18:33:54 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-03-19 18:33:54 +0000 |
| commit | 2797d329261859a5848769a90d0b933bcba75520 (patch) | |
| tree | 88aaddb586b7aa7fed60d3f031a7ba2fab18d901 /clang/lib/Sema | |
| parent | f65a0b6e21f627ae7b8baaa7a3032824419f532a (diff) | |
| download | bcm5719-llvm-2797d329261859a5848769a90d0b933bcba75520.tar.gz bcm5719-llvm-2797d329261859a5848769a90d0b933bcba75520.zip | |
Add a clarifying comment about HasPrototype's computation
llvm-svn: 67316
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index a50381123c3..99ea7077606 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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) || |

