summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wshadow-4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wshadow-4.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/Wshadow-4.C32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-4.C b/gcc/testsuite/g++.dg/warn/Wshadow-4.C
new file mode 100644
index 000000000..c033028d7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-4.C
@@ -0,0 +1,32 @@
+// PR c++/39526
+// { dg-options "-Wshadow" }
+
+class INetURLObject
+{
+public:
+ INetURLObject(int i);
+ int GetMainURL() const;
+};
+
+int foo(int infoo) // { dg-bogus "shadowed declaration" }
+{
+ int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" }
+ extern void f(int infoo);
+ struct A
+ {
+ void f(int infoo) { } // { dg-bogus "shadows a parameter" }
+ };
+ return outfoo;
+}
+
+// PR c++/39763
+int foo2(void)
+{
+ int infoo = 0; // { dg-bogus "shadowed declaration" }
+ int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" }
+ struct A
+ {
+ void f(int infoo) { } // { dg-bogus "shadows a previous local" }
+ };
+ return outfoo;
+}