Mercurial > hg > CbC > CbC_llvm
view clang/test/SemaCXX/warn-unused-attribute.cpp @ 221:79ff65ed7e25
LLVM12 Original
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 Jun 2021 19:15:29 +0900 |
parents | 1d019706d866 |
children |
line wrap: on
line source
// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s struct __attribute__((warn_unused)) Test { Test(); ~Test(); void use(); }; struct TestNormal { TestNormal(); }; int main(void) { Test unused; // expected-warning {{unused variable 'unused'}} Test used; TestNormal normal; used.use(); int i __attribute__((warn_unused)) = 12; // expected-warning {{'warn_unused' attribute only applies to structs, unions, and classes}} return i; }