Bug 22487 - C++ front-end produces mis-match types in EQ_EXPR (array constructor)
Summary: C++ front-end produces mis-match types in EQ_EXPR (array constructor)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: build, patch
Depends on:
Blocks: 22368
  Show dependency treegraph
 
Reported: 2005-07-14 13:46 UTC by Andrew Pinski
Modified: 2005-11-04 09:47 UTC (History)
2 users (show)

See Also:
Host:
Target: 64bit targets
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-08-05 05:13:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-07-14 13:46:29 UTC
Testcase only in 64bit mode where sizeof (long) != sizeof(int):
struct c
{
  int t;
  int y;
  c();
};
template <typename T>
T *
allocbuf (unsigned long size)
{
  return new T[size];
}
c * a = allocbuf<c>(10);


See PR 22368 for the patch to detect this.
Comment 1 Andrew Pinski 2005-07-14 13:49:17 UTC
Oh, this has nothing to do with templates at all, reduced further:
struct c
{
  int t;
  int y;
  c();
};
c *
allocbuf (unsigned long size)
{
  return new c[size];
}
Comment 2 Andrew Pinski 2005-07-14 18:31:45 UTC
Another testcase:
struct QRgbMap {
  QRgbMap();
};
void convert_32_to_8() {
  QRgbMap table[10];
}
Comment 3 Andrew Pinski 2005-08-05 05:13:11 UTC
Confirmed:
t.cc:14: error: types mismatch in comparsion
long intD.5
intD.2
D.1753 != -1;
Comment 4 Andrew Pinski 2005-10-09 20:47:16 UTC
Even further reduced testcase:
struct _Words     {_Words();};
_Words _M_local_word[2];

---
This shows up while bootstrapping on x86_64-pc-linux-gnu.
Comment 5 Richard Biener 2005-11-04 09:46:48 UTC
Subject: Bug 22487

Author: rguenth
Date: Fri Nov  4 09:46:43 2005
New Revision: 106487

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106487
Log:
2005-11-04  Richard Guenther  <rguenther@suse.de>

	PR c++/22487
	* init.c (build_vec_init): Build comparison of matching
	types.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/init.c

Comment 6 Richard Biener 2005-11-04 09:47:19 UTC
Fixed.