aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-10-21 17:44:04 -0400
committerJason Merrill <jason@gcc.gnu.org>2000-10-21 17:44:04 -0400
commitaca77bd196cb6f04c215db0380c77dda140b0258 (patch)
tree9e176ae2ca30f22b3b8c361b8ed56389f44884f1 /gcc/testsuite
parentfac045536fefda3972f6c5d42ab60431a41f6d03 (diff)
downloadgcc-aca77bd196cb6f04c215db0380c77dda140b0258.zip
gcc-aca77bd196cb6f04c215db0380c77dda140b0258.tar.gz
gcc-aca77bd196cb6f04c215db0380c77dda140b0258.tar.bz2
parse.y (operator): Set got_object from got_scope.
* parse.y (operator): Set got_object from got_scope. Set looking_for_typename. * decl.c (lookup_name_real): Clear val after setting from_obj. Reorganize diagnostic. From-SVN: r37000
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup19.C54
1 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup19.C b/gcc/testsuite/g++.old-deja/g++.other/lookup19.C
new file mode 100644
index 0000000..e355f2d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup19.C
@@ -0,0 +1,54 @@
+// Test for proper handling of type lookup for conversion operator names.
+// Build don't link:
+
+// Test 1: Only at file scope
+typedef int B;
+struct A
+{
+ int B;
+ operator B *();
+};
+
+A::operator B * ()
+{
+ return 0;
+}
+
+// Test 2: Only at class scope
+struct C
+{
+ typedef int D;
+ operator D *();
+};
+
+int D;
+C::operator D * ()
+{
+ return 0;
+}
+
+// Test 3: Matching
+struct E
+{
+ typedef int F;
+ operator F *();
+};
+
+typedef int F;
+E::operator F * ()
+{
+ return 0;
+}
+
+// Test 4: Conflicting
+struct G
+{
+ typedef int H;
+ operator H *();
+};
+
+typedef double H;
+G::operator H * () // ERROR - mismatch
+{
+ return 0;
+}