summaryrefslogtreecommitdiffstats
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorAlexey Bader <alexey.bader@intel.com>2017-10-11 11:16:31 +0000
committerAlexey Bader <alexey.bader@intel.com>2017-10-11 11:16:31 +0000
commitcaaaf1b95ed9e016f314b61bf74453da91dda1ce (patch)
tree7509e1e361f018b01aa07b1123d18ef73b89489d /lib/Parse/ParseDecl.cpp
parent41ca94e92225baa5370fcbdb414d3999ef4eabbe (diff)
[OpenCL] Allow function declaration with empty argument list.
Treat 'f()' as 'f(void)' rather than a function w/o a prototype. Reviewers: Anastasia, yaxunl Reviewed By: Anastasia, yaxunl Subscribers: cfe-commits, echuraev, chapuni Differential Revision: https://reviews.llvm.org/D33681 Re-apply revision 306653. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 8bca7badea..098bf9b12d 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -5989,7 +5989,8 @@ void Parser::ParseFunctionDeclarator(Declarator &D,
else if (RequiresArg)
Diag(Tok, diag::err_argument_required_after_attribute);
- HasProto = ParamInfo.size() || getLangOpts().CPlusPlus;
+ HasProto = ParamInfo.size() || getLangOpts().CPlusPlus
+ || getLangOpts().OpenCL;
// If we have the closing ')', eat it.
Tracker.consumeClose();