PATCH for nontype template argument conversion
Mark Mitchell
mmitchell@usa.net
Wed Mar 25 13:51:00 GMT 1998
Jason --
Here's a patch to fix the bug in the enclosed test-case. Is it OK?
--
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available
Wed Mar 25 13:00:13 1998 Mark Mitchell <mmitchell@usa.net>
* cvt.c (perform_qualification_conversions): Use comp_target_types
instead of comp_ptr_ttypes.
Index: gcc/cp/cvt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/cvt.c,v
retrieving revision 1.15
diff -c -p -r1.15 cvt.c
*** cvt.c 1998/03/12 00:29:09 1.15
--- cvt.c 1998/03/25 20:56:29
*************** perform_qualification_conversions (type,
*** 1078,1084 ****
tree type;
tree expr;
{
! if (comp_ptr_ttypes (type, TREE_TYPE(expr)))
return build1 (NOP_EXPR, type, expr);
else
return error_mark_node;
--- 1078,1084 ----
tree type;
tree expr;
{
! if (comp_target_types (type, TREE_TYPE(expr), 0) == 1)
return build1 (NOP_EXPR, type, expr);
else
return error_mark_node;
Index: gcc/testsuite/g++.old-deja/g++.pt/nontype2.C
===================================================================
RCS file: nontype2.C
diff -N nontype2.C
*** /dev/null Mon Dec 31 20:00:00 1979
--- nontype2.C Wed Mar 25 12:56:29 1998
***************
*** 0 ****
--- 1,20 ----
+ // Build don't link:
+
+ enum E { };
+
+ template <const E* ep>
+ struct S1
+ {
+ };
+
+
+ struct S2
+ {
+ static E es[1];
+ };
+
+
+ struct S3
+ {
+ typedef S1<S2::es> S3_Type;
+ };
More information about the Gcc-bugs
mailing list