From 853d21a18aeaf98be0c3b3fa67a59dd94b3b756d Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 12 Aug 2009 00:45:33 +0000 Subject: [PATCH] Warn on use of property dot syntax when unused. llvm-svn: 78760 --- clang/lib/AST/Expr.cpp | 1 - clang/test/SemaObjC/unused.m | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 6aa971112d57..ce8bb516c090 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -540,7 +540,6 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1, return false; } case ObjCMessageExprClass: - case ObjCKVCRefExprClass: // Dot syntax for message send. return false; case StmtExprClass: { // Statement exprs don't logically have side effects themselves, but are diff --git a/clang/test/SemaObjC/unused.m b/clang/test/SemaObjC/unused.m index 44d31ab7ec75..ce77cf1b5f56 100644 --- a/clang/test/SemaObjC/unused.m +++ b/clang/test/SemaObjC/unused.m @@ -25,8 +25,7 @@ int test1(void) { @end void test2() { - // No unused warning: rdar://7126285 - @"pointless example call for test purposes".length; + @"pointless example call for test purposes".length; // expected-warning {{expression result unused}} }