summaryrefslogtreecommitdiffstats
path: root/test/Parser/cxx11-stmt-attributes.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
committerdim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
commit056abd2059c65a3e908193aeae16fad98017437c (patch)
tree2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/Parser/cxx11-stmt-attributes.cpp
parentcc73504950eb7b5dff2dded9bedd67bc36d64641 (diff)
downloadFreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip
FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'test/Parser/cxx11-stmt-attributes.cpp')
-rw-r--r--test/Parser/cxx11-stmt-attributes.cpp77
1 files changed, 51 insertions, 26 deletions
diff --git a/test/Parser/cxx11-stmt-attributes.cpp b/test/Parser/cxx11-stmt-attributes.cpp
index fab5621..f26db79 100644
--- a/test/Parser/cxx11-stmt-attributes.cpp
+++ b/test/Parser/cxx11-stmt-attributes.cpp
@@ -2,53 +2,78 @@
void foo(int i) {
- [[unknown_attribute]] ;
- [[unknown_attribute]] { }
- [[unknown_attribute]] if (0) { }
- [[unknown_attribute]] for (;;);
- [[unknown_attribute]] do {
- [[unknown_attribute]] continue;
+ [[unknown_attribute]] ; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] { } // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] if (0) { } // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] for (;;); // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] do { // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] continue; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
} while (0);
- [[unknown_attribute]] while (0);
+ [[unknown_attribute]] while (0); // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
- [[unknown_attribute]] switch (i) {
- [[unknown_attribute]] case 0:
- [[unknown_attribute]] default:
- [[unknown_attribute]] break;
+ [[unknown_attribute]] switch (i) { // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] case 0: // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] default: // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] break; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
}
- [[unknown_attribute]] goto here;
- [[unknown_attribute]] here:
+ [[unknown_attribute]] goto here; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+ [[unknown_attribute]] here: // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
- [[unknown_attribute]] try {
+ [[unknown_attribute]] try { // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
} catch (...) {
}
- [[unknown_attribute]] return;
-
+ [[unknown_attribute]] return; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+
alignas(8) ; // expected-warning {{attribute aligned cannot be specified on a statement}}
[[noreturn]] { } // expected-warning {{attribute noreturn cannot be specified on a statement}}
[[noreturn]] if (0) { } // expected-warning {{attribute noreturn cannot be specified on a statement}}
[[noreturn]] for (;;); // expected-warning {{attribute noreturn cannot be specified on a statement}}
[[noreturn]] do { // expected-warning {{attribute noreturn cannot be specified on a statement}}
- [[unavailable]] continue; // TODO: only noreturn, alignas and carries_dependency are parsed in C++ 11 syntax at the moment, hence no warning here
+ [[unavailable]] continue; // expected-warning {{unknown attribute 'unavailable' ignored}}
+ } while (0);
+ [[unknown_attributqqq]] while (0); // expected-warning {{unknown attribute 'unknown_attributqqq' ignored}}
+ // TODO: remove 'qqq' part and enjoy 'empty loop body' warning here (DiagnoseEmptyLoopBody)
+
+ [[unknown_attribute]] while (0); // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
+
+ [[unused]] switch (i) { // expected-warning {{unknown attribute 'unused' ignored}}
+ [[uuid]] case 0: // expected-warning {{unknown attribute 'uuid' ignored}}
+ [[visibility]] default: // expected-warning {{unknown attribute 'visibility' ignored}}
+ [[carries_dependency]] break; // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
+ }
+
+ [[fastcall]] goto there; // expected-warning {{unknown attribute 'fastcall' ignored}}
+ [[noinline]] there: // expected-warning {{unknown attribute 'noinline' ignored}}
+
+ [[lock_returned]] try { // expected-warning {{unknown attribute 'lock_returned' ignored}}
+ } catch (...) {
+ }
+
+ [[weakref]] return; // expected-warning {{unknown attribute 'weakref' ignored}}
+
+ [[carries_dependency]] ; // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
+ [[carries_dependency]] { } // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
+ [[carries_dependency]] if (0) { } // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
+ [[carries_dependency]] for (;;); // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
+ [[carries_dependency]] do { // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
+ [[carries_dependency]] continue; // expected-warning {{attribute carries_dependency cannot be specified on a statement}} ignored}}
} while (0);
- [[unknown_attributqqq]] while (0); // TODO: remove 'qqq' part and enjoy 'empty loop body' warning here (DiagnoseEmptyLoopBody)
- [[unknown_attribute]] while (0); // no warning here yet, just an unknown attribute
+ [[carries_dependency]] while (0); // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
- [[unused]] switch (i) { // TODO: only noreturn, alignas and carries_dependency are parsed in C++ 11 syntax at the moment, hence no warning here
- [[uuid]] case 0: // TODO: only noreturn, alignas and carries_dependency are parsed in C++ 11 syntax at the moment, hence no warning here
- [[visibility]] default: // TODO: only noreturn, alignas and carries_dependency are parsed in C++ 11 syntax at the moment, hence no warning here
+ [[carries_dependency]] switch (i) { // expected-warning {{attribute carries_dependency cannot be specified on a statement}} ignored}}
+ [[carries_dependency]] case 0: // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
+ [[carries_dependency]] default: // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
[[carries_dependency]] break; // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
}
- [[fastcall]] goto there; // TODO: only noreturn, alignas and carries_dependency are parsed in C++ 11 syntax at the moment, hence no warning here
- [[noinline]] there: // TODO: only noreturn, alignas and carries_dependency are parsed in C++ 11 syntax at the moment, hence no warning here
+ [[carries_dependency]] goto here; // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
- [[lock_returned]] try { // TODO: only noreturn, alignas and carries_dependency are parsed in C++ 11 syntax at the moment, hence no warning here
+ [[carries_dependency]] try { // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
} catch (...) {
}
- [[weakref]] return; // TODO: only noreturn, alignas and carries_dependency are parsed in C++ 11 syntax at the moment, hence no warning here
+ [[carries_dependency]] return; // expected-warning {{attribute carries_dependency cannot be specified on a statement}}
}
OpenPOWER on IntegriCloud