mirror of https://github.com/microsoft/clang.git
Disable the warning for missing prototypes for OpenCL kernels. Includes testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160766 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a2ad394dad
commit
a95b4f73c4
|
@ -7509,6 +7509,10 @@ static bool ShouldWarnAboutMissingPrototype(const FunctionDecl *FD) {
|
|||
if (FD->isFunctionTemplateSpecialization())
|
||||
return false;
|
||||
|
||||
// Don't warn for OpenCL kernels.
|
||||
if (FD->hasAttr<OpenCLKernelAttr>())
|
||||
return false;
|
||||
|
||||
bool MissingPrototype = true;
|
||||
for (const FunctionDecl *Prev = FD->getPreviousDecl();
|
||||
Prev; Prev = Prev->getPreviousDecl()) {
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-prototypes %s
|
||||
|
||||
void f() { } // expected-warning {{no previous prototype for function 'f'}}
|
||||
|
||||
// Don't warn about kernel functions.
|
||||
kernel void g() { }
|
Loading…
Reference in New Issue