summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/deprecated-3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/deprecated-3.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/deprecated-3.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/deprecated-3.C b/gcc/testsuite/g++.dg/warn/deprecated-3.C
new file mode 100644
index 000000000..8b4378c41
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/deprecated-3.C
@@ -0,0 +1,14 @@
+/* PR 17947 bad warning with implicit conversion and __attribute__((deprecated)) */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct Foo
+{
+ operator int() __attribute__((deprecated));
+};
+
+void g(void)
+{
+ Foo f;
+ (int)f; // { dg-warning "'Foo::operator int\\(\\)' is deprecated \\(declared at" }
+}