[cfe-commits] r159130 - /cfe/trunk/test/SemaCXX/warn-unused-member.cpp
Daniel Jasper
djasper at google.com
Mon Jun 25 02:19:47 PDT 2012
Author: djasper
Date: Mon Jun 25 04:19:47 2012
New Revision: 159130
URL: http://llvm.org/viewvc/llvm-project?rev=159130&view=rev
Log:
Add test for -Wused-but-marked-unused on private fields.
Modified:
cfe/trunk/test/SemaCXX/warn-unused-member.cpp
Modified: cfe/trunk/test/SemaCXX/warn-unused-member.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-unused-member.cpp?rev=159130&r1=159129&r2=159130&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-unused-member.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-unused-member.cpp Mon Jun 25 04:19:47 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wunused-private-field -verify -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -Wunused-private-field -Wused-but-marked-unused -verify -std=c++11 %s
class NotFullyDefined {
public:
@@ -93,6 +93,7 @@
trivial_(), user_constructor_(42),
initialized_with_side_effect_(side_effect()) {
used_ = 42;
+ attr_used_ = 42; // expected-warning{{'attr_used_' was marked unused but was used}}
}
A(int x, A* a) : pointer_(a) {}
@@ -116,7 +117,8 @@
NonTrivialConstructor non_trivial_constructor_;
NonTrivialDestructor non_trivial_destructor_;
- int attr_ __attribute__((unused));
+ int attr_ __attribute__((unused));
+ int attr_used_ __attribute__((unused));
};
class EverythingUsed {
More information about the cfe-commits
mailing list