r306660 - Revert r306653, "[OpenCL] Allow function declaration with empty argument list."
NAKAMURA Takumi via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 29 03:47:24 PDT 2017
Author: chapuni
Date: Thu Jun 29 03:47:23 2017
New Revision: 306660
URL: http://llvm.org/viewvc/llvm-project?rev=306660&view=rev
Log:
Revert r306653, "[OpenCL] Allow function declaration with empty argument list."
It broke bots.
Removed:
cfe/trunk/test/SemaOpenCL/function-no-args.cl
Modified:
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=306660&r1=306659&r2=306660&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Thu Jun 29 03:47:23 2017
@@ -4355,7 +4355,7 @@ static TypeSourceInfo *GetFullTypeForDec
FunctionType::ExtInfo EI(getCCForDeclaratorChunk(S, D, FTI, chunkIndex));
- if (!FTI.NumParams && !FTI.isVariadic && !LangOpts.CPlusPlus && !LangOpts.OpenCL) {
+ if (!FTI.NumParams && !FTI.isVariadic && !LangOpts.CPlusPlus) {
// Simple void foo(), where the incoming T is the result type.
T = Context.getFunctionNoProtoType(T, EI);
} else {
Removed: cfe/trunk/test/SemaOpenCL/function-no-args.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/function-no-args.cl?rev=306659&view=auto
==============================================================================
--- cfe/trunk/test/SemaOpenCL/function-no-args.cl (original)
+++ cfe/trunk/test/SemaOpenCL/function-no-args.cl (removed)
@@ -1,9 +0,0 @@
-// RUN: %clang_cc1 -verify -pedantic -fsyntax-only -cl-std=CL2.0 %s
-// expected-no-diagnostics
-
-global int gi;
-int my_func();
-int my_func() {
- gi = 2;
- return gi;
-}
Modified: cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl?rev=306660&r1=306659&r2=306660&view=diff
==============================================================================
--- cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl (original)
+++ cfe/trunk/test/SemaOpenCL/invalid-pipes-cl2.0.cl Thu Jun 29 03:47:23 2017
@@ -3,7 +3,7 @@
global pipe int gp; // expected-error {{type '__global read_only pipe int' can only be used as a function parameter in OpenCL}}
global reserve_id_t rid; // expected-error {{the '__global reserve_id_t' type cannot be used to declare a program scope variable}}
-extern pipe write_only int get_pipe(); // expected-error {{type '__global write_only pipe int (void)' can only be used as a function parameter in OpenCL}}
+extern pipe write_only int get_pipe(); // expected-error {{type '__global write_only pipe int ()' can only be used as a function parameter in OpenCL}}
kernel void test_invalid_reserved_id(reserve_id_t ID) { // expected-error {{'reserve_id_t' cannot be used as the type of a kernel parameter}}
}
More information about the cfe-commits
mailing list