OSDN Git Service

PR c++/42266
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Dec 2009 00:26:27 +0000 (00:26 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Dec 2009 00:26:27 +0000 (00:26 +0000)
* cvt.c (convert_from_reference): Do nothing if TREE_TYPE is null.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154964 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/variadic97.C [new file with mode: 0644]

index f11ee70..deb5903 100644 (file)
@@ -1,3 +1,8 @@
+2009-12-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42266
+       * cvt.c (convert_from_reference): Do nothing if TREE_TYPE is null.
+
 2009-12-03  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/42217
index 8c5b001..6f3b56e 100644 (file)
@@ -506,7 +506,8 @@ convert_to_reference (tree reftype, tree expr, int convtype,
 tree
 convert_from_reference (tree val)
 {
-  if (TREE_CODE (TREE_TYPE (val)) == REFERENCE_TYPE)
+  if (TREE_TYPE (val)
+      && TREE_CODE (TREE_TYPE (val)) == REFERENCE_TYPE)
     {
       tree t = TREE_TYPE (TREE_TYPE (val));
       tree ref = build1 (INDIRECT_REF, t, val);
index 0f9311b..ff7a355 100644 (file)
@@ -1,3 +1,8 @@
+2009-12-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42266
+       * g++.dg/cpp0x/variadic97.C: New.
+
 2009-12-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/42049
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic97.C b/gcc/testsuite/g++.dg/cpp0x/variadic97.C
new file mode 100644 (file)
index 0000000..a207031
--- /dev/null
@@ -0,0 +1,35 @@
+// PR c++/42266
+// { dg-options -std=c++0x }
+
+template<typename... _Elements>
+  class tuple;
+
+template<typename _Arg>
+  class _Mu;
+
+template<typename _Signature>
+  struct _Bind;
+
+template<typename _Functor, typename... _Bound_args>
+  class _Bind<_Functor(_Bound_args...)>
+  {
+    template<typename... _Args, typename
+             = decltype(_Functor()(_Mu<_Bound_args>()(_Bound_args(),
+                                                      tuple<_Args...>())...) )>
+      void __call() { }
+  };
+
+template<typename _Functor, typename _Arg>
+  _Bind<_Functor(_Arg)>
+  bind(_Functor, _Arg) { }
+
+struct State
+{
+  bool ready() { return true; }
+
+  void f()
+  {
+    bind(&State::ready, this);
+  }
+};
+