summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/return.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/return.cpp')
-rw-r--r--test/SemaCXX/return.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/SemaCXX/return.cpp b/test/SemaCXX/return.cpp
index e682fdf..6bdbe52 100644
--- a/test/SemaCXX/return.cpp
+++ b/test/SemaCXX/return.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -fsyntax-only -Wignored-qualifiers -verify
int test1() {
throw;
@@ -16,3 +16,13 @@ template<typename T>
T h() {
return 17;
}
+
+// Don't warn on cv-qualified class return types, only scalar return types.
+namespace ignored_quals {
+struct S {};
+const S class_c();
+const volatile S class_cv();
+
+const int scalar_c(); // expected-warning{{'const' type qualifier on return type has no effect}}
+const volatile int scalar_cv(); // expected-warning{{'const volatile' type qualifiers on return type have no effect}}
+}
OpenPOWER on IntegriCloud