diff options
author | Jason Merrill <jason@redhat.com> | 2012-09-04 15:35:02 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-09-04 15:35:02 -0400 |
commit | afba316b4627a4ce2613af1321319c85c7cf6ebe (patch) | |
tree | e73fbab07bf2629e125cd71f85977259ffc29c4e /gcc | |
parent | 427b8bb8d72906eb1d4f631cea84e82c4e091247 (diff) | |
download | gcc-afba316b4627a4ce2613af1321319c85c7cf6ebe.zip gcc-afba316b4627a4ce2613af1321319c85c7cf6ebe.tar.gz gcc-afba316b4627a4ce2613af1321319c85c7cf6ebe.tar.bz2 |
re PR c++/54198 ("error: invalid use of incomplete type" when building Chromium)
PR c++/54198
* decl.c (check_default_argument): Set cp_unevaluated_operand
around call to perform_implicit_conversion_flags.
From-SVN: r190949
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/defarg15.C | 19 |
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 47498cb..9148bbe 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2012-09-04 Jason Merrill <jason@redhat.com> + PR c++/54198 + * decl.c (check_default_argument): Set cp_unevaluated_operand + around call to perform_implicit_conversion_flags. + PR c++/54437 PR c++/51213 * pt.c (fn_type_unification): Call coerce_template_parms before diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 8b94e26..8024373 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10575,8 +10575,10 @@ check_default_argument (tree decl, tree arg) A default argument expression is implicitly converted to the parameter type. */ + ++cp_unevaluated_operand; perform_implicit_conversion_flags (decl_type, arg, tf_warning_or_error, LOOKUP_NORMAL); + --cp_unevaluated_operand; if (warn_zero_as_null_pointer_constant && c_inhibit_evaluation_warnings == 0 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1c0bde0..0082a9c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2012-09-04 Jason Merrill <jason@redhat.com> + PR c++/54198 + * g++.dg/template/defarg15.C: New. + PR c++/54437 * g++.dg/template/access24.C: New. diff --git a/gcc/testsuite/g++.dg/template/defarg15.C b/gcc/testsuite/g++.dg/template/defarg15.C new file mode 100644 index 0000000..fea3dee --- /dev/null +++ b/gcc/testsuite/g++.dg/template/defarg15.C @@ -0,0 +1,19 @@ +// PR c++/54198 + +template <typename T> void +refIfNotNull (T* p1) +{ + p1->ref; +} +template <typename T> struct A +{ + A (T* p1) + { + refIfNotNull (p1); + } +}; +class B; +class C +{ + void getParent (A <B> = 0); +}; |