Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / ignored-reference-qualifiers-disabled.cpp
blobfde65fb382a88640e5356057a0367ecc135b3ae0
1 // RUN: %clang_cc1 %s -std=c++11 -Wignored-qualifiers -Wno-ignored-reference-qualifiers -verify=both
2 // RUN: %clang_cc1 %s -std=c++11 -Wignored-qualifiers -verify=both,qual
4 const int scalar_c(); // both-warning{{'const' type qualifier on return type has no effect}}
5 volatile int scalar_v(); // both-warning{{'volatile' type qualifier on return type has no effect}}
6 const volatile int scalar_cv(); // both-warning{{'const volatile' type qualifiers on return type have no effect}}
8 typedef int& IntRef;
10 const IntRef ref_c(); // qual-warning{{'const' qualifier on reference type 'IntRef' (aka 'int &') has no effect}}
11 volatile IntRef ref_v(); // qual-warning{{'volatile' qualifier on reference type 'IntRef' (aka 'int &') has no effect}}
12 const volatile IntRef ref_cv(); // qual-warning{{'const' qualifier on reference type 'IntRef' (aka 'int &') has no effect}} \
13 qual-warning{{'volatile' qualifier on reference type 'IntRef' (aka 'int &') has no effect}}
15 template<typename T>
16 class container {
17 using value_type = T;
18 using reference = value_type&;
19 reference get();
20 const reference get() const; // qual-warning{{'const' qualifier on reference type 'reference' (aka 'T &') has no effect}}