]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/27495 (ICE using "." instead of "->")
authorSteve Ellcey <sje@cup.hp.com>
Thu, 20 Jul 2006 17:46:57 +0000 (17:46 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Thu, 20 Jul 2006 17:46:57 +0000 (17:46 +0000)
PR c++/27495
* search.c (adjust_result_of_qualified_name_lookup): Change
assert to part of if statement.
* g++.dg/other/pr27495.C: New.

From-SVN: r115627

gcc/cp/ChangeLog
gcc/cp/search.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/pr27495.C [new file with mode: 0644]

index babd2f41d73d32c0287259770e5aa036c52f317d..6ecba8ae9bc5c79c5a9a1a8b4aac46bedcc2f0f4 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-20  Steve Ellcey  <sje@cup.hp.com>
+
+       PR c++/27495
+       * search.c (adjust_result_of_qualified_name_lookup): Change
+       assert to part of if statement.
+
 2006-07-18  Steve Ellcey  <sje@cup.hp.com>
 
        PR c++/28304
index ef0f82eefeb97b3869d6bd9db2254cac4c23e833..aed8a7aeb0b131daf047f6e244d3995acbc2641a 100644 (file)
@@ -1484,14 +1484,13 @@ adjust_result_of_qualified_name_lookup (tree decl,
                                        tree context_class)
 {
   if (context_class && context_class != error_mark_node
+      && CLASS_TYPE_P (context_class)
       && CLASS_TYPE_P (qualifying_scope)
       && DERIVED_FROM_P (qualifying_scope, context_class)
       && BASELINK_P (decl))
     {
       tree base;
 
-      gcc_assert (CLASS_TYPE_P (context_class));
-
       /* Look for the QUALIFYING_SCOPE as a base of the CONTEXT_CLASS.
         Because we do not yet know which function will be chosen by
         overload resolution, we cannot yet check either accessibility
index 5f15fb089d56da39d6acd3d2cb9ea751924ef856..d0fb7afb00f7c2f60f418df0ba7ccff3a395e3a8 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-20  Steve Ellcey  <sje@cup.hp.com>
+
+       PR c++/27495
+       * g++.dg/other/pr27495.C: New.
+
 2006-07-18  Steve Ellcey  <sje@cup.hp.com>
 
        PR c++/28304
diff --git a/gcc/testsuite/g++.dg/other/pr27495.C b/gcc/testsuite/g++.dg/other/pr27495.C
new file mode 100644 (file)
index 0000000..990b1ee
--- /dev/null
@@ -0,0 +1,8 @@
+
+// Test to make sure we do not ICE on this invalid program.
+
+struct A
+{
+    template<int> void foo();
+    void bar() { this.A::foo<0>(); }   // { dg-error "" }
+};