warn-unused-value.cpp revision 0faede6f31b07bcec7b776f2b420c3ea9bb3e58c
1// RUN: %clang_cc1 -fsyntax-only -verify -Wunused-value %s
2
3// PR4806
4namespace test0 {
5  class Box {
6  public:
7    int i;
8    volatile int j;
9  };
10
11  void doit() {
12    // pointer to volatile has side effect (thus no warning)
13    Box* box = new Box;
14    box->i; // expected-warning {{expression result unused}}
15    box->j;
16  }
17}
18