This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16333] New: More array vs ptr stuff


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]