re PR c++/11766 (ICE in comp_ptr_ttypes_real)
authorNathan Sidwell <nathan@codesourcery.com>
Sun, 3 Aug 2003 14:19:00 +0000 (14:19 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Sun, 3 Aug 2003 14:19:00 +0000 (14:19 +0000)
cp:
PR c++/11766
* typeck.c (comp_ptr_ttypes_real): Don't loop on pointers to
member functions.
testsuite:
PR c++/11766
* g++.dg/expr/ptrmem1.C: New test.

From-SVN: r70118

gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/expr/ptrmem1.C [new file with mode: 0644]

index dd7e0af..d450d0a 100644 (file)
@@ -6030,7 +6030,7 @@ comp_ptr_ttypes_real (tree to, tree from, int constp)
            constp &= TYPE_READONLY (to);
        }
 
-      if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTR_TO_MEMBER_P (to))
+      if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRMEM_P (to))
        return ((constp >= 0 || to_more_cv_qualified)
                && same_type_ignoring_top_level_qualifiers_p (to, from));
     }
index e1fa217..61d9742 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-03  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/11766
+       * g++.dg/expr/ptrmem1.C: New test.
+
 2003-08-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/9453
diff --git a/gcc/testsuite/g++.dg/expr/ptrmem1.C b/gcc/testsuite/g++.dg/expr/ptrmem1.C
new file mode 100644 (file)
index 0000000..146143a
--- /dev/null
@@ -0,0 +1,33 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Aug 2003 <nathan@codesourcery.com>
+
+// PR 11766. ICE
+
+template<typename T>
+struct normal_iterator
+{
+  normal_iterator(const T& __i);
+};
+
+
+template<typename _Tp>
+struct vector
+{
+  void end() const {  normal_iterator<const _Tp*> (this->pt); }
+  void size() const { end(); }
+  _Tp* pt;
+};
+  
+
+
+struct MuonTag {
+  typedef void (MuonTag::*Selector)();
+};
+
+void foo()
+{
+  vector<MuonTag::Selector> _selectors;
+  _selectors.size();
+}