diff options
Diffstat (limited to 'test/SemaCXX/return.cpp')
-rw-r--r-- | test/SemaCXX/return.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/SemaCXX/return.cpp b/test/SemaCXX/return.cpp index 2f98a27..580f0a7 100644 --- a/test/SemaCXX/return.cpp +++ b/test/SemaCXX/return.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -fcxx-exceptions -fexceptions -fsyntax-only -Wignored-qualifiers -verify +// RUN: %clang_cc1 %s -std=c++11 -fcxx-exceptions -fexceptions -fsyntax-only -Wignored-qualifiers -verify int test1() { throw; @@ -45,6 +45,27 @@ const j(); const volatile int scalar_cv(); // expected-warning{{'const volatile' type qualifiers on return type have no effect}} + +// FIXME: Maintain enough information that we can point the diagnostic at the 'volatile' keyword. +const +int S::* +volatile +mixed_ret(); // expected-warning {{'volatile' type qualifier on return type has no effect}} + +const int volatile // expected-warning {{'const volatile' type qualifiers on return type have no effect}} + (((parens()))); + +_Atomic(int) atomic(); + +_Atomic // expected-warning {{'_Atomic' type qualifier on return type has no effect}} + int + atomic(); + +auto + trailing_return_type() -> // expected-warning {{'const' type qualifier on return type has no effect}} + const int; + +const int ret_array()[4]; // expected-error {{cannot return array}} } namespace PR9328 { @@ -56,6 +77,7 @@ namespace PR9328 { } class foo { + operator const int (); operator int * const (); }; |