summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/warn-unused-label.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-17 07:39:24 +0000
committerChris Lattner <sabre@nondot.org>2011-02-17 07:39:24 +0000
commitc8e630e4db137cbe4bb28193f83c4092e24fd502 (patch)
treea98339a71fb56d6625a8475b69a92acb5ece8180 /clang/test/Sema/warn-unused-label.c
parentf7b2c93b2f50270fa921c6c90358e92ad3b1c702 (diff)
downloadbcm5719-llvm-c8e630e4db137cbe4bb28193f83c4092e24fd502.tar.gz
bcm5719-llvm-c8e630e4db137cbe4bb28193f83c4092e24fd502.zip
Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
Diffstat (limited to 'clang/test/Sema/warn-unused-label.c')
-rw-r--r--clang/test/Sema/warn-unused-label.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Sema/warn-unused-label.c b/clang/test/Sema/warn-unused-label.c
index 163446002e6..03be7da2fc9 100644
--- a/clang/test/Sema/warn-unused-label.c
+++ b/clang/test/Sema/warn-unused-label.c
@@ -4,8 +4,8 @@ void f() {
a:
goto a;
b: // expected-warning{{unused}}
- c: __attribute__((unused));
- d: __attribute__((noreturn)); // expected-warning {{The only valid attribute for labels is 'unused'}}
+ c: __attribute__((unused)); // expected-warning {{unused label 'c'}}
+ d: __attribute__((noreturn)); // expected-warning {{the only valid attribute for labels is 'unused'}}
goto d;
return;
}
OpenPOWER on IntegriCloud