From b057bff4c1c94c7e0086e9c7cd4b3c8bca40da92 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Sat, 12 Mar 2011 07:28:20 +0000 Subject: [PATCH] =?UTF-8?q?re=20PR=20c++/46824=20(chromium-compile=20faile?= =?UTF-8?q?d=20because=20error:=20no=20match=20for=20=E2=80=98operator*?= =?UTF-8?q?=E2=80=99=20in)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR c++/46824 gcc/cp/ * call.c (add_builtin_candidate): The type of the argument of the indirection operator should not be dependent. Fix the comment. gcc/testsuite/ * g++.dg/conversion/cast3.C: New test. From-SVN: r170897 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/call.c | 4 ++-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/conversion/cast3.C | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/conversion/cast3.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7c1e739ad70..bebb1fcee5d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-03-11 Dodji Seketeli + + * call.c (add_builtin_candidate): The type of + the argument of the indirection operator should not be dependent. + Fix the comment. + 2011-03-11 Jason Merrill PR c++/47125 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index a297f5313e3..5953e3524cc 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2150,7 +2150,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, } return; -/* 7 For every cv-qualified or cv-unqualified complete object type T, there +/* 7 For every cv-qualified or cv-unqualified object type T, there exist candidate operator functions of the form T& operator*(T*); @@ -2161,7 +2161,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, case INDIRECT_REF: if (TREE_CODE (type1) == POINTER_TYPE - && is_complete (TREE_TYPE (type1)) + && !uses_template_parms (TREE_TYPE (type1)) && (TYPE_PTROB_P (type1) || TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)) break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9652b4aae30..412188a01a7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-03-11 Dodji Seketeli + + * g++.dg/conversion/cast3.C: New test. + 2011-03-11 Jason Merrill * g++.dg/template/error45.C: New. diff --git a/gcc/testsuite/g++.dg/conversion/cast3.C b/gcc/testsuite/g++.dg/conversion/cast3.C new file mode 100644 index 00000000000..43287a1eb36 --- /dev/null +++ b/gcc/testsuite/g++.dg/conversion/cast3.C @@ -0,0 +1,14 @@ +// Origin: PR c++/46824 + +class Incomplete; +struct Ptr +{ + operator Incomplete*(); +}; + +int +main() +{ + Ptr p; + *p; +}