This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36852] [4.3/4.4 Regression] Two dimensional array in template method argument list incorrectly interpreted.
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2008 20:24:42 -0000
- Subject: [Bug c++/36852] [4.3/4.4 Regression] Two dimensional array in template method argument list incorrectly interpreted.
- References: <bug-36852-15268@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-07-17 20:24 -------
So here is how to get an ICE out of the trunk.
--- t.h ----
class A
{
public:
template <class T> static T foo1(T [3][3]);
};
template <class T> T A::foo1(T t[3][3])
{
return t[0][1];
}
--- t.cc ---
#include "t.h"
#include "t.h"
---- CMD ---
g++ t.h
g++ t.cc
In file included from t.cc:2:
t.h:2: error: redefinition of 'class A'
t.h:3: error: previous definition of 'class A'
t.h:8: internal compiler error: canonical types differ for identical types T
[3] and T [3]
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
If we don't use a PCH, it works correctly.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |diagnostic, error-recovery,
| |ice-on-invalid-code
Last reconfirmed|0000-00-00 00:00:00 |2008-07-17 20:24:42
date| |
Summary|Two dimensional array in |[4.3/4.4 Regression] Two
|template method argument |dimensional array in
|list incorrectly |template method argument
|interpreted. |list incorrectly
| |interpreted.
Target Milestone|--- |4.3.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36852