summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/report.C
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.old-deja/g++.jason/report.C
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/report.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/report.C77
1 files changed, 77 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/report.C b/gcc/testsuite/g++.old-deja/g++.jason/report.C
new file mode 100644
index 000000000..b595662c2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/report.C
@@ -0,0 +1,77 @@
+// { dg-do assemble }
+// { dg-options "-Wreturn-type" }
+// GROUPS passed error-reporting
+
+// DR 295 allows qualification via typedef
+
+template <char C>
+class badoo
+{
+};
+
+template <int (*F) (int)>
+class doowop
+{
+};
+
+struct A
+{
+ int a;
+ ~A () { a = 0; }
+ operator int () { return a; }
+};
+
+extern "C" int atoi (const char *);
+
+int (*fee)(const char *) = atoi;
+int (**bar)(const char *) = &fee;
+
+const char* s = "4";
+const char** sp = &s;
+const char*** spp = &sp;
+
+int foo (int a = (**bar) (s))
+{
+ return doowop<foo>::bar; // { dg-error "" } not a member
+}
+
+int foo2 (int (*a)(int) = &foo)
+{
+ undef4 (1); // { dg-error "" } implicit declaration
+ return 1;
+}
+
+class X{
+ class Y{}; // { dg-error "" } private
+};
+
+typedef int const * bart ();
+//The following is DR295 dependant
+typedef bart const * const * bar2;
+typedef bart volatile * const * bar2v;
+
+bar2 baz (X::Y y) // { dg-error "" } in this context
+{
+ X::Y f; // { dg-error "" } in this context
+ bar2 wa [5];
+ wa[0] = baz(f);
+ undef2 (1); // { dg-error "" } implicit declaration
+} // { dg-warning "no return statement" }
+
+int ninny ()
+{
+ struct A
+ {
+ static int ninny2 () { return badoo<'\001'>::foo; } // { dg-error "" } not a member
+ };
+
+ return A::ninny2();
+}
+
+int darg (char X::*p)
+{
+ undef3 (1); // { dg-error "" } implicit declaration
+} // { dg-warning "no return statement" }
+
+// { dg-message "warning: control reaches end of non-void function" "" { target *-*-* } 36 }
+// { dg-message "warning: control reaches end of non-void function" "" { target *-*-* } 65 }