1 // RUN: %clang_cc1 %s -fcxx-exceptions -fexceptions -fsyntax-only -Wignored-qualifiers -verify
8 template<typename T> T f() { }
20 // Don't warn on cv-qualified class return types, only scalar return types.
21 namespace ignored_quals {
24 const volatile S class_cv();
26 const int scalar_c(); // expected-warning{{'const' type qualifier on return type has no effect}}
27 int const scalar_c2(); // expected-warning{{'const' type qualifier on return type has no effect}}
31 const // expected-warning{{'const' type qualifier on return type has no effect}}
36 const // expected-warning{{'const' type qualifier on return type has no effect}}
39 char* const h(); // expected-warning{{'const' type qualifier on return type has no effect}}
40 char* volatile i(); // expected-warning{{'volatile' type qualifier on return type has no effect}}
43 volatile // expected-warning{{'const volatile' type qualifiers on return type have no effect}}
47 const volatile int scalar_cv(); // expected-warning{{'const volatile' type qualifiers on return type have no effect}}
54 const PCHAR GetName() { return 0; } // expected-warning{{'const' type qualifier on return type has no effect}}
59 operator int * const ();
67 template <class VarType>
68 void Test(const VarType& value) {
73 namespace return_has_expr {
76 return 42; // expected-error {{constructor 'S' should not return a value}}
79 return 42; // expected-error {{destructor '~S' should not return a value}}