This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16333] New: More array vs ptr stuff
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jul 2004 18:59:47 -0000
- Subject: [Bug c++/16333] New: More array vs ptr stuff
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Another instance where we decay arrays too quickly to pointers:
------------------
struct X {
X (const int (&)[3]);
};
int a[3];
X foo () { return a; }
X bar () { return X(a); }
------------------
bar() compiles, foo() doesn't:
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc
x.cc: In function `X foo()':
x.cc:7: error: conversion from `int*' to non-scalar type `X' requested
I think it should (and so does icc).
W.
--
Summary: More array vs ptr stuff
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16333