add type attribute warn_unused, for -Wunused-variable warnings (pr#14253)
authorLubos Lunak <l.lunak@suse.cz>
Sat, 20 Jul 2013 15:05:36 +0000 (15:05 +0000)
committerLubos Lunak <l.lunak@suse.cz>
Sat, 20 Jul 2013 15:05:36 +0000 (15:05 +0000)
commitedc138880d8543d60de08be2698b695821888752
treeb514814718f9e2069b2d8beda49401e1487fd084
parentba5ee4da1dcb6aad861e63467c8fc9ddd69bf8f7
add type attribute warn_unused, for -Wunused-variable warnings (pr#14253)

The functionality is equivalent to the GCC attribute. Variables of tagged
types will be warned about as unused if they are not used in any way
except for possible (even non-trivial) ctors/dtors called. Useful for tagging
classes like std::string (which is not part of this commit).

llvm-svn: 186765
clang/include/clang/Basic/Attr.td
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/SemaCXX/warn-unused-attribute.cpp [new file with mode: 0644]