summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-09-19 23:03:35 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-09-19 23:03:35 +0000
commit1b2ad2fd9e2d5352144481aa1fd995d333d9adc9 (patch)
treea34cfa46d5e8f82d4de034dfb0af58150fc5f5b8
parent6dff2288a8054bdbc97217568e5831bcce809db8 (diff)
downloadclang-1b2ad2fd9e2d5352144481aa1fd995d333d9adc9.tar.gz
Revert r114316, -Wunused-value enabled by default was intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114318 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td8
-rw-r--r--test/Analysis/dead-stores.c4
-rw-r--r--test/Analysis/misc-ps.m4
-rw-r--r--test/Misc/caret-diags-macros.c2
-rw-r--r--test/Parser/expressions.m2
-rw-r--r--test/Parser/objc-messaging-1.m21
-rw-r--r--test/Parser/objc-try-catch-1.m8
-rw-r--r--test/Preprocessor/pragma_microsoft.c2
-rw-r--r--test/Sema/enum.c4
-rw-r--r--test/Sema/ext_vector_components.c2
-rw-r--r--test/Sema/i-c-e.c8
-rw-r--r--test/Sema/statements.c2
-rw-r--r--test/Sema/unused-expr.c2
-rw-r--r--test/SemaCXX/cast-conversion.cpp3
-rw-r--r--test/SemaCXX/decl-expr-ambiguity.cpp4
-rw-r--r--test/SemaCXX/overloaded-operator.cpp2
-rw-r--r--test/SemaCXX/warn-unused-variables.cpp2
-rw-r--r--test/SemaObjC/invalid-code.m2
18 files changed, 47 insertions, 35 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 68d504fc1c..9508c913ec 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -2770,16 +2770,16 @@ def ext_typecheck_expression_not_constant_but_accepted : Extension<
"expression is not a constant, but is accepted as one by GNU extensions">,
InGroup<GNU>;
def warn_unused_expr : Warning<"expression result unused">,
- InGroup<UnusedValue>, DefaultIgnore;
+ InGroup<UnusedValue>;
def warn_unused_voidptr : Warning<
"expression result unused; should this cast be to 'void'?">,
- InGroup<UnusedValue>, DefaultIgnore;
+ InGroup<UnusedValue>;
def warn_unused_property_expr : Warning<
"property access result unused - getters should not be used for side effects">,
- InGroup<UnusedValue>, DefaultIgnore;
+ InGroup<UnusedValue>;
def warn_unused_call : Warning<
"ignoring return value of function declared with %0 attribute">,
- InGroup<UnusedValue>, DefaultIgnore;
+ InGroup<UnusedValue>;
def err_incomplete_type_used_in_type_trait_expr : Error<
"incomplete type %0 used in type trait expression">;
diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c
index ad7890b6b1..c150fa088d 100644
--- a/test/Analysis/dead-stores.c
+++ b/test/Analysis/dead-stores.c
@@ -300,11 +300,11 @@ void f22() {
case 7:
(void)(0 && x);
(void)y7;
- (void)(0 || (y8, ({ return; }), 1));
+ (void)(0 || (y8, ({ return; }), 1)); // expected-warning {{expression result unused}}
(void)x;
break;
case 8:
- (void)(1 && (y9, ({ return; }), 1));
+ (void)(1 && (y9, ({ return; }), 1)); // expected-warning {{expression result unused}}
(void)x;
break;
case 9:
diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m
index 190c605b5c..bb70c90e6a 100644
--- a/test/Analysis/misc-ps.m
+++ b/test/Analysis/misc-ps.m
@@ -466,7 +466,7 @@ unsigned char test_array_index_bitwidth(const unsigned char *p) {
// It should not crash.
void test_block_cast() {
id test_block_cast_aux();
- (void (^)(void *))test_block_cast_aux();
+ (void (^)(void *))test_block_cast_aux(); // expected-warning{{expression result unused}}
}
int OSAtomicCompareAndSwap32Barrier();
@@ -673,7 +673,7 @@ CGFloat rdar7242006(CGFloat x) {
// when not explicitly used in an "lvalue" context (as far as the analyzer is
// concerned). This previously triggered a crash due to an invalid assertion.
void pr_4988(void) {
- pr_4988;
+ pr_4988; // expected-warning{{expression result unused}}
}
// <rdar://problem/7152418> - A 'signed char' is used as a flag, which is
diff --git a/test/Misc/caret-diags-macros.c b/test/Misc/caret-diags-macros.c
index 90902dba82..e138f59d60 100644
--- a/test/Misc/caret-diags-macros.c
+++ b/test/Misc/caret-diags-macros.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wunused-value %s > %t 2>&1
+// RUN: %clang_cc1 -fsyntax-only %s > %t 2>&1
#define M1(x) x
diff --git a/test/Parser/expressions.m b/test/Parser/expressions.m
index 95042327d1..1f1005a792 100644
--- a/test/Parser/expressions.m
+++ b/test/Parser/expressions.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wunused-value -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
void test1() {
@"s"; // expected-warning {{expression result unused}}
diff --git a/test/Parser/objc-messaging-1.m b/test/Parser/objc-messaging-1.m
index 0708989728..82450df9f2 100644
--- a/test/Parser/objc-messaging-1.m
+++ b/test/Parser/objc-messaging-1.m
@@ -6,14 +6,21 @@ int main ()
id a, b, c;
[a ii]; // expected-warning{{not found}}
[a if: 1 :2]; // expected-warning{{not found}}
- [a inout: 1 :2 another:(2,3,4)]; // expected-warning{{not found}}
- [a inout: 1 :2 another:(2,3,4), 6,6,8]; // expected-warning{{not found}}
- [a inout: 1 :2 another:(2,3,4), (6,4,5),6,8]; // expected-warning{{not found}}
- [a inout: 1 :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}}
- [a long: 1 :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}}
- [a : "Hello\n" :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}}
+ [a inout: 1 :2 another:(2,3,4)]; // expected-warning{{not found}} \
+ // expected-warning 2{{expression result unused}}
+ [a inout: 1 :2 another:(2,3,4), 6,6,8]; // expected-warning{{not found}} \
+ // expected-warning 2{{expression result unused}}
+ [a inout: 1 :2 another:(2,3,4), (6,4,5),6,8]; // expected-warning{{not found}} \
+ // expected-warning 4{{expression result unused}}
+ [a inout: 1 :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}} \
+ // expected-warning 2{{expression result unused}}
+ [a long: 1 :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}} \
+ // expected-warning 2{{expression result unused}}
+ [a : "Hello\n" :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}} \
+ // expected-warning 2{{expression result unused}}
// Comma expression as receiver (rdar://6222856)
- [a, b, c foo]; // expected-warning{{not found}}
+ [a, b, c foo]; // expected-warning{{not found}} \
+ // expected-warning 2{{expression result unused}}
}
diff --git a/test/Parser/objc-try-catch-1.m b/test/Parser/objc-try-catch-1.m
index 00c86e7a43..719369124e 100644
--- a/test/Parser/objc-try-catch-1.m
+++ b/test/Parser/objc-try-catch-1.m
@@ -27,13 +27,15 @@ void * foo()
return proc();
}
@catch (Frob* ex) {
- @throw 1,2; // expected-error {{@throw requires an Objective-C object type ('int' invalid)}}
+ @throw 1,2; // expected-error {{@throw requires an Objective-C object type ('int' invalid)}} \
+ // expected-warning {{expression result unused}}
}
@catch (float x) { // expected-error {{@catch parameter is not a pointer to an interface type}}
}
@catch(...) {
- @throw (4,3,proc());
+ @throw (4,3,proc()); // expected-warning {{expression result unused}} \
+ // expected-warning {{expression result unused}}
}
}
@@ -46,7 +48,7 @@ void * foo()
void bar()
{
@try {}// expected-error {{@try statement without a @catch and @finally clause}}
- @"s";
+ @"s"; // expected-warning {{result unused}}
}
void baz()
diff --git a/test/Preprocessor/pragma_microsoft.c b/test/Preprocessor/pragma_microsoft.c
index 0300e43764..b68d6e363e 100644
--- a/test/Preprocessor/pragma_microsoft.c
+++ b/test/Preprocessor/pragma_microsoft.c
@@ -36,5 +36,5 @@ void f()
// If we ever actually *support* __pragma(warning(disable: x)),
// this warning should go away.
- MACRO_WITH__PRAGMA
+ MACRO_WITH__PRAGMA // expected-warning {{expression result unused}}
}
diff --git a/test/Sema/enum.c b/test/Sema/enum.c
index 5782cb8daf..64aa31bc4b 100644
--- a/test/Sema/enum.c
+++ b/test/Sema/enum.c
@@ -44,10 +44,10 @@ void test4() {
;
(_Bool)ve2; // expected-error {{arithmetic or pointer type is required}}
- for (; ;ve2)
+ for (; ;ve2) // expected-warning {{expression result unused}}
;
(void)ve2;
- ve2;
+ ve2; // expected-warning {{expression result unused}}
}
// PR2416
diff --git a/test/Sema/ext_vector_components.c b/test/Sema/ext_vector_components.c
index 1b663528fb..7d3d52aa95 100644
--- a/test/Sema/ext_vector_components.c
+++ b/test/Sema/ext_vector_components.c
@@ -16,7 +16,7 @@ static void test() {
vec2.z; // expected-error {{vector component access exceeds type 'float2'}}
vec2.xyzw; // expected-error {{vector component access exceeds type 'float2'}}
- vec4.xyzw;
+ vec4.xyzw; // expected-warning {{expression result unused}}
vec4.xyzc; // expected-error {{illegal vector component name 'c'}}
vec4.s01z; // expected-error {{illegal vector component name 'z'}}
vec2 = vec4.s01; // legal, shorten
diff --git a/test/Sema/i-c-e.c b/test/Sema/i-c-e.c
index b4a6a69cce..eb77bbe3b9 100644
--- a/test/Sema/i-c-e.c
+++ b/test/Sema/i-c-e.c
@@ -50,9 +50,11 @@ char y[__builtin_constant_p(expr) ? -1 : 1];
char z[__builtin_constant_p(4) ? 1 : -1];
// Comma tests
-int comma1[0?1,2:3];
-int comma2[1||(1,2)]; // expected-warning {{use of logical || with constant operand}}
-int comma3[(1,2)]; // expected-warning {{size of static array must be an integer constant expression}}
+int comma1[0?1,2:3]; // expected-warning {{expression result unused}}
+int comma2[1||(1,2)]; // expected-warning {{expression result unused}} \
+ // expected-warning {{use of logical || with constant operand}}
+int comma3[(1,2)]; // expected-warning {{size of static array must be an integer constant expression}} \
+ // expected-warning {{expression result unused}}
// Pointer + __builtin_constant_p
char pbcp[__builtin_constant_p(4) ? (intptr_t)&expr : 0]; // expected-error {{variable length array declaration not allowed at file scope}}
diff --git a/test/Sema/statements.c b/test/Sema/statements.c
index 428ad3128c..61eafe6ff0 100644
--- a/test/Sema/statements.c
+++ b/test/Sema/statements.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -Wunused-value -verify
+// RUN: %clang_cc1 %s -fsyntax-only -verify
typedef unsigned __uint32_t;
diff --git a/test/Sema/unused-expr.c b/test/Sema/unused-expr.c
index ac209eb3ab..15608ec8a4 100644
--- a/test/Sema/unused-expr.c
+++ b/test/Sema/unused-expr.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-unreachable-code -Wunused-value
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-unreachable-code
int foo(int X, int Y);
diff --git a/test/SemaCXX/cast-conversion.cpp b/test/SemaCXX/cast-conversion.cpp
index 9ca8d15b85..d68e789c37 100644
--- a/test/SemaCXX/cast-conversion.cpp
+++ b/test/SemaCXX/cast-conversion.cpp
@@ -15,7 +15,8 @@ struct B {
int main () {
B(10); // expected-error {{functional-style cast from 'int' to 'B' is not allowed}}
(B)10; // expected-error {{C-style cast from 'int' to 'B' is not allowed}}
- static_cast<B>(10); // expected-error {{static_cast from 'int' to 'B' is not allowed}}
+ static_cast<B>(10); // expected-error {{static_cast from 'int' to 'B' is not allowed}} \\
+ // expected-warning {{expression result unused}}
}
template<class T>
diff --git a/test/SemaCXX/decl-expr-ambiguity.cpp b/test/SemaCXX/decl-expr-ambiguity.cpp
index 631d1aafae..9595faece2 100644
--- a/test/SemaCXX/decl-expr-ambiguity.cpp
+++ b/test/SemaCXX/decl-expr-ambiguity.cpp
@@ -12,11 +12,11 @@ void f() {
__typeof(int)(a,5)<<a; // expected-error {{excess elements in scalar initializer}}
void(a), ++a;
if (int(a)+1) {}
- for (int(a)+1;;) {}
+ for (int(a)+1;;) {} // expected-warning {{expression result unused}}
a = sizeof(int()+1);
a = sizeof(int(1));
typeof(int()+1) a2; // expected-error {{extension used}}
- (int(1));
+ (int(1)); // expected-warning {{expression result unused}}
// type-id
(int())1; // expected-error {{C-style cast from 'int' to 'int ()' is not allowed}}
diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp
index 09e0a5fa5e..a33ea5dede 100644
--- a/test/SemaCXX/overloaded-operator.cpp
+++ b/test/SemaCXX/overloaded-operator.cpp
@@ -157,7 +157,7 @@ bool& operator,(X, Y);
void test_comma(X x, Y y) {
bool& b1 = (x, y);
- X& xr = (x, x);
+ X& xr = (x, x); // expected-warning {{expression result unused}}
}
struct Callable {
diff --git a/test/SemaCXX/warn-unused-variables.cpp b/test/SemaCXX/warn-unused-variables.cpp
index be992fa407..6992cdcd09 100644
--- a/test/SemaCXX/warn-unused-variables.cpp
+++ b/test/SemaCXX/warn-unused-variables.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-value -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s
template<typename T> void f() {
T t;
t = 17;
diff --git a/test/SemaObjC/invalid-code.m b/test/SemaObjC/invalid-code.m
index 83ccf105df..7a642fb107 100644
--- a/test/SemaObjC/invalid-code.m
+++ b/test/SemaObjC/invalid-code.m
@@ -9,7 +9,7 @@ void test1() {
// This previously triggered a crash because the class has not been defined.
@implementation RDar7495713 (rdar_7495713_cat) // expected-error{{cannot find interface declaration for 'RDar7495713'}}
- (id) rdar_7495713 {
- __PRETTY_FUNCTION__;
+ __PRETTY_FUNCTION__; // expected-warning{{expression result unused}}
}
@end