aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2001-11-15 10:09:43 -0500
committerJason Merrill <jason@gcc.gnu.org>2001-11-15 10:09:43 -0500
commit8a2b77e7376a10b62a023843a64d4998fde5b5da (patch)
tree3a2e64bbd40a3c54769c05fc7a160ad65a8d29fc /gcc/testsuite
parent9bddde52b4cf9c9a4609e2288893c57a1da0abd7 (diff)
downloadgcc-8a2b77e7376a10b62a023843a64d4998fde5b5da.zip
gcc-8a2b77e7376a10b62a023843a64d4998fde5b5da.tar.gz
gcc-8a2b77e7376a10b62a023843a64d4998fde5b5da.tar.bz2
parse.y: Add ...
* parse.y: Add ... IDENTIFIER SCOPE and ... PTYPENAME SCOPE expansions. * decl.c (make_typename_type): Handle getting a class template. * search.c (lookup_field_r): A class template is good enough for want_type. * call.c (convert_like_real): Only use cp_convert for the bad part. (standard_conversion): Also allow bad int->enum. * typeck.c (ptr_reasonably_similar): Also allow functions to interconvert. Pointers to same-size integers are reasonably similar. * cvt.c (convert_to_void): If we build a new COND_EXPR, always give it void type. From-SVN: r47060
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.dg/ext/conv1.C3
-rw-r--r--gcc/testsuite/g++.dg/overload/cond1.C24
-rw-r--r--gcc/testsuite/g++.dg/template/type1.C8
3 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/conv1.C b/gcc/testsuite/g++.dg/ext/conv1.C
index 4c0d848..6c16fe4 100644
--- a/gcc/testsuite/g++.dg/ext/conv1.C
+++ b/gcc/testsuite/g++.dg/ext/conv1.C
@@ -13,4 +13,7 @@ int main ()
f (i);
f (v);
g (v);
+ enum { a } b = i;
+ void (*p2)(int) = p;
+ unsigned *ip = &i;
}
diff --git a/gcc/testsuite/g++.dg/overload/cond1.C b/gcc/testsuite/g++.dg/overload/cond1.C
new file mode 100644
index 0000000..74f0f3c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/cond1.C
@@ -0,0 +1,24 @@
+// Test that converting a COND_EXPR to void doesn't result in trying to
+// bitwise copy a class with a nontrivial copy constructor (and thus a
+// compiler abort).
+
+// { dg-options "-O" }
+
+struct A {
+ virtual ~A() { }
+};
+
+A a1, a2;
+inline A& one () { return a1; }
+inline A& two () { return a2; }
+
+inline void f (int i)
+{
+ i ? a1 : a2;
+ i ? one() : two();
+}
+
+int main ()
+{
+ f (1);
+}
diff --git a/gcc/testsuite/g++.dg/template/type1.C b/gcc/testsuite/g++.dg/template/type1.C
new file mode 100644
index 0000000..cd5cf5f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/type1.C
@@ -0,0 +1,8 @@
+// Test for helpful error messages on invalid nested-name-specifiers.
+
+struct A {
+ template <class T> struct B { static int c; };
+};
+
+int A::B::c; // { dg-error "parameters" }
+int A::C::d; // { dg-error "no type" }