summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wunused-17.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wunused-17.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/Wunused-17.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wunused-17.C b/gcc/testsuite/g++.dg/warn/Wunused-17.C
new file mode 100644
index 000000000..217bb4b77
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wunused-17.C
@@ -0,0 +1,19 @@
+// PR c++/41109, 41110, 41134
+// { dg-options "-Wunused" }
+
+int memory_consumption(const int &t) { return sizeof(t); }
+
+int s;
+int g() { return memory_consumption(s); }
+
+template <int> struct X { static const int s = 2; };
+
+template <typename T> int f() {
+ const unsigned int dim = 2;
+ return X<dim>::s;
+}
+
+template int f<int>();
+
+static int i;
+template <typename> int h() { return i; }