summaryrefslogtreecommitdiffstats
path: root/clang/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
commit1f2779407e7f042ae853674f9db067263bed49bd (patch)
treed8db9bfc0cbff22d90bd707c906b9f488cdc8812 /clang/lib/Parse/ParseDecl.cpp
parent19d7299a8b51f62c6a3dfd91ac4bc5258db860ac (diff)
downloadbcm5719-llvm-1f2779407e7f042ae853674f9db067263bed49bd.tar.gz
bcm5719-llvm-1f2779407e7f042ae853674f9db067263bed49bd.zip
[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. llvm-svn: 315453
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 8bca7badea2..098bf9b12d7 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud