Disable the warning for missing prototypes for OpenCL kernels. Includes testcase.

llvm-svn: 160766
This commit is contained in:
Tanya Lattner 2012-07-26 00:08:28 +00:00
parent 80b4ac76c5
commit 4bfc355094
2 changed files with 10 additions and 0 deletions

View File

@ -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()) {

View File

@ -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() { }