fixing:
VoidMethod.m:14:5: warning: expression result unused
[Greeter hello];
^~~~~~~~~~~~~~~
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42380
91177308-0d34-0410-b5e6-
96231b3b80d8
// TODO: check attributes for pure/const. "void foo() { strlen("bar"); }"
// should warn.
return true;
+ case ObjCMessageExprClass:
+ return true;
case CastExprClass:
// If this is a cast to void, check the operand. Otherwise, the result of
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
projectDirPath = "";
--- /dev/null
+// RUN: clang %s -verify -fsyntax-only
+#include <stdio.h>
+
+@interface Greeter
++ (void) hello;
+@end
+
+@implementation Greeter
++ (void) hello {
+ fprintf(stdout, "Hello, World!\n");
+}
+@end
+
+int main (void) {
+ [Greeter hello];
+ return 0;
+}
+