diagnose C99 6.9.1p5, C arguments in definitions that are lacking
a name. This implements PR3208.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61127 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 424ce7f..6ef9ecd 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -720,6 +720,11 @@
Param->setInvalidDecl();
HasInvalidParm = true;
}
+
+ // C99 6.9.1p5: If the declarator includes a parameter type list, the
+ // declaration of each parameter shall include an identifier.
+ if (Param->getIdentifier() == 0 && !getLangOptions().CPlusPlus)
+ Diag(Param->getLocation(), diag::err_parameter_name_omitted);
}
return HasInvalidParm;