diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaCXX/return.cpp | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
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 (); }; |