summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/block-return.c
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-07-14 06:36:18 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-07-14 06:36:18 +0000
commitcb3b5a483fde37bce8086fc074f822962c58d952 (patch)
tree0448841834bd2ac0791acd144ffae63b05c5f384 /clang/test/Sema/block-return.c
parentbad47f62f6e104687943389d2b151f1a1a2db35b (diff)
downloadbcm5719-llvm-cb3b5a483fde37bce8086fc074f822962c58d952.tar.gz
bcm5719-llvm-cb3b5a483fde37bce8086fc074f822962c58d952.zip
Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.
This flag and warning match GCC semantics. Also, move it to -Wextra as this is a largely cosmetic issue and doesn't seem to mask problems. Subsequent fixes to the tests which no longer by default emit the warning. Added explicit test cases for both C and C++ behavior with the warning turned on. llvm-svn: 108325
Diffstat (limited to 'clang/test/Sema/block-return.c')
-rw-r--r--clang/test/Sema/block-return.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/test/Sema/block-return.c b/clang/test/Sema/block-return.c
index 33fd183be06..5a4ec010d3a 100644
--- a/clang/test/Sema/block-return.c
+++ b/clang/test/Sema/block-return.c
@@ -109,10 +109,9 @@ void foo6() {
void foo7()
{
- const int (^BB) (void) = ^{ const int i = 1; return i; }; // expected-error{{incompatible block pointer types initializing 'int const (^)(void)' with an expression of type 'int (^)(void)'}} \
- // expected-warning{{type qualifier on return type has no effect}}
+ const int (^BB) (void) = ^{ const int i = 1; return i; }; // expected-error{{incompatible block pointer types initializing 'int const (^)(void)' with an expression of type 'int (^)(void)'}}
- const int (^CC) (void) = ^const int{ const int i = 1; return i; }; // expected-warning{{type qualifier on return type has no effect}}
+ const int (^CC) (void) = ^const int{ const int i = 1; return i; };
int i;
OpenPOWER on IntegriCloud