| 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 |
| 3 |
|
| 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}} |
| 7 |
|
| 8 |
typedef int& IntRef; |
| 9 |
|
| 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}} |
| 14 |
|
| 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}} |
| 21 |
}; |