Bug 24666 - [meta-bug] array decaying to pointers
Summary: [meta-bug] array decaying to pointers
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid, meta-bug, rejects-valid
Depends on: 11858 24663 24664 94501 5786 16333 41426 59879 94924 102033 102039 102044
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-04 04:46 UTC by Andrew Pinski
Modified: 2021-08-24 22:32 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-07-09 05:27:22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-11-04 04:46:32 UTC
There are a many of these problems that have been filed, I think we should have a meta-bug for it.
Comment 1 Andrew Pinski 2005-11-04 04:49:55 UTC
4 bugs that I could find now (two were filed today).
Comment 2 Patrick Palka 2015-12-17 04:02:19 UTC
Author: ppalka
Date: Thu Dec 17 04:01:47 2015
New Revision: 231736

URL: https://gcc.gnu.org/viewcvs?rev=231736&root=gcc&view=rev
Log:
Fix some blockers of PR c++/24666 (arrays decay to pointers too early)

gcc/cp/ChangeLog:

	PR c++/16333
	PR c++/41426
	PR c++/59878
	PR c++/66895
	* typeck.c (convert_for_initialization): Don't perform an early
	decaying conversion if converting to a class type.

gcc/testsuite/ChangeLog:

	PR c++/16333
	PR c++/41426
	PR c++/59878
	PR c++/66895
	* g++.dg/conversion/pr16333.C: New test.
	* g++.dg/conversion/pr41426.C: New test.
	* g++.dg/conversion/pr59878.C: New test.
	* g++.dg/conversion/pr66895.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/conversion/pr16333.C
    trunk/gcc/testsuite/g++.dg/conversion/pr41426.C
    trunk/gcc/testsuite/g++.dg/conversion/pr59878.C
    trunk/gcc/testsuite/g++.dg/conversion/pr66895.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Patrick Palka 2016-01-19 00:19:48 UTC
Author: ppalka
Date: Tue Jan 19 00:19:16 2016
New Revision: 232547

URL: https://gcc.gnu.org/viewcvs?rev=232547&root=gcc&view=rev
Log:
Fix the remaining PR c++/24666 blockers (arrays decay to pointers too early)

gcc/cp/ChangeLog:

	PR c++/11858
	PR c++/24663
	PR c++/24664
	* decl.c (grokdeclarator): Don't decay array parameter type to
	a pointer type if it's dependent.
	(grokparms): Invoke strip_top_quals instead of directly invoking
	cp_build_qualified_type.
	* pt.c (decay_dependent_array_parm_type): New static function.
	(type_unification_real): Call decay_dependent_array_parm_type
	to decay a dependent array parameter type to its corresponding
	pointer type before unification.
	(more_specialized_fn): Likewise.
	(get_bindings): Likewise.
	* tree.c (cp_build_qualified_type): Trivial typofix in
	documentation.

gcc/testsuite/ChangeLog:

	PR c++/11858
	PR c++/24663
	PR c++/24664
	* g++.dg/template/pr11858.C: New test.
	* g++.dg/template/pr24663.C: New test.
	* g++.dg/template/unify12.C: New test.
	* g++.dg/template/unify13.C: New test.
	* g++.dg/template/unify14.C: New test.
	* g++.dg/template/unify15.C: New test.
	* g++.dg/template/unify16.C: New test.
	* g++.dg/template/unify17.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/template/pr11858.C
    trunk/gcc/testsuite/g++.dg/template/pr24663.C
    trunk/gcc/testsuite/g++.dg/template/unify12.C
    trunk/gcc/testsuite/g++.dg/template/unify13.C
    trunk/gcc/testsuite/g++.dg/template/unify14.C
    trunk/gcc/testsuite/g++.dg/template/unify15.C
    trunk/gcc/testsuite/g++.dg/template/unify16.C
    trunk/gcc/testsuite/g++.dg/template/unify17.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 Patrick Palka 2016-01-24 17:45:53 UTC
Author: ppalka
Date: Sun Jan 24 17:45:21 2016
New Revision: 232778

URL: https://gcc.gnu.org/viewcvs?rev=232778&root=gcc&view=rev
Log:
Revert "Fix the remaining PR c++/24666 blockers"

gcc/cp/ChangeLog:

	Revert:
	2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>

	PR c++/11858
	PR c++/24663
	PR c++/24664
	* decl.c (grokdeclarator): Don't decay array parameter type to
	a pointer type if it's dependent.
	(grokparms): Invoke strip_top_quals instead of directly invoking
	cp_build_qualified_type.
	* pt.c (decay_dependent_array_parm_type): New static function.
	(type_unification_real): Call decay_dependent_array_parm_type
	to decay a dependent array parameter type to its corresponding
	pointer type before unification.
	(more_specialized_fn): Likewise.
	(get_bindings): Likewise.
	* tree.c (cp_build_qualified_type): Trivial typofix in
	documentation.

gcc/testsuite/ChangeLog:

	Revert:
	2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>

	PR c++/11858
	PR c++/24663
	PR c++/24664
	* g++.dg/template/pr11858.C: New test.
	* g++.dg/template/pr24663.C: New test.
	* g++.dg/template/unify12.C: New test.
	* g++.dg/template/unify13.C: New test.
	* g++.dg/template/unify14.C: New test.
	* g++.dg/template/unify15.C: New test.
	* g++.dg/template/unify16.C: New test.
	* g++.dg/template/unify17.C: New test.


Removed:
    trunk/gcc/testsuite/g++.dg/template/pr11858.C
    trunk/gcc/testsuite/g++.dg/template/pr24663.C
    trunk/gcc/testsuite/g++.dg/template/unify12.C
    trunk/gcc/testsuite/g++.dg/template/unify13.C
    trunk/gcc/testsuite/g++.dg/template/unify14.C
    trunk/gcc/testsuite/g++.dg/template/unify15.C
    trunk/gcc/testsuite/g++.dg/template/unify16.C
    trunk/gcc/testsuite/g++.dg/template/unify17.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog