brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · fde65fb Raw
22 lines · cpp
1// RUN: %clang_cc1 %s -std=c++11 -Wignored-qualifiers -Wno-ignored-reference-qualifiers -verify=both2// RUN: %clang_cc1 %s -std=c++11 -Wignored-qualifiers -verify=both,qual3 4const int scalar_c(); // both-warning{{'const' type qualifier on return type has no effect}}5volatile int scalar_v(); // both-warning{{'volatile' type qualifier on return type has no effect}}6const volatile int scalar_cv(); // both-warning{{'const volatile' type qualifiers on return type have no effect}}7 8typedef int& IntRef;9 10const IntRef ref_c(); // qual-warning{{'const' qualifier on reference type 'IntRef' (aka 'int &') has no effect}}11volatile IntRef ref_v(); // qual-warning{{'volatile' qualifier on reference type 'IntRef' (aka 'int &') has no effect}}12const 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}}14 15template<typename T>16class 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}}21};22