]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/19298 (dependent type (references) and calling a function method)
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 7 Jan 2005 17:09:15 +0000 (17:09 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 7 Jan 2005 17:09:15 +0000 (17:09 +0000)
cp:
PR c++/19298
* pt.c (tsubst_qualified_id): Call convert_from_reference.
testsuite:
PR c++/19298
* g++.dg/template/ref2.C: New.

From-SVN: r93055

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/ref2.C [new file with mode: 0644]

index dee21a972b4543bc65d608554f0f7c0a8f6998b5..9abb9c8d395890eaf13c139180f4d793b723aa9f 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-07  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/19298
+       * pt.c (tsubst_qualified_id): Call convert_from_reference.
+
 2005-01-06  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/19244
index ad852c5a136b00b66402c877c7b64aa5c90dc288..972e2669b55fa550f6f877c0f83112f85ebc04b0 100644 (file)
@@ -7648,6 +7648,8 @@ tsubst_qualified_id (tree qualified_id, tree args,
              (expr, scope, current_class_type));
       expr = finish_qualified_id_expr (scope, expr, done, address_p);
     }
+  
+  expr = convert_from_reference (expr);
 
   return expr;
 }
index 832d43a25053be9ea57c176c5757b5663d996436..46a2093794e54f1824c9e307a4ba89aacb3d5912 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-07  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/19298
+       * g++.dg/template/ref2.C: New.
+
 2005-01-07  Andrew Pinski  <pinskia@physics.uc.edu>
 
        * gcc.c-torture/compile/pr17529.c (y): Change size of array to 1
diff --git a/gcc/testsuite/g++.dg/template/ref2.C b/gcc/testsuite/g++.dg/template/ref2.C
new file mode 100644 (file)
index 0000000..9feb19d
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Jan 2005 <nathan@codesourcery.com>
+
+// PR 19298: Rejects legal
+// Origin: Andrew Pinski <pinskia@gcc.gnu.org>
+
+struct t
+{
+  void f() const;
+};
+
+template <typename _Tp>
+struct A
+{
+ static t const&  c;
+};
+
+template <typename _Tp>
+void g(void)
+{
+  A<_Tp>::c.f();
+}
+
+void h(void)
+{
+  g<int>();
+}
This page took 0.102817 seconds and 5 git commands to generate.