public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16333] New: More array vs ptr stuff
@ 2004-07-02 18:59 bangerth at dealii dot org
  2004-07-02 19:02 ` [Bug c++/16333] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 3+ messages in thread
From: bangerth at dealii dot org @ 2004-07-02 18:59 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/16333] More array vs ptr stuff
  2004-07-02 18:59 [Bug c++/16333] New: More array vs ptr stuff bangerth at dealii dot org
@ 2004-07-02 19:02 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-02 19:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-02 19:02 -------
Confirmed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |2.95.3 3.0.4 3.2.3 3.3.3
                   |                            |3.4.0 3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-02 19:02:03
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16333


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/16333] More array vs ptr stuff
       [not found] <bug-16333-4@http.gcc.gnu.org/bugzilla/>
@ 2023-12-05 17:54 ` cvs-commit at gcc dot gnu.org
  0 siblings, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-05 17:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16333

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

https://gcc.gnu.org/g:1dad3df1e7f3fd73f157f88561ef424b6853d960

commit r14-6190-g1dad3df1e7f3fd73f157f88561ef424b6853d960
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Tue Dec 5 17:53:50 2023 +0000

    Restore build with GCC 4.8 to GCC 5

    GCC 5 and earlier applied array-to-pointer decay too early,
    which affected the new attribute namespace code.  A reduced
    example of the construct that the attribute code uses is:

        struct S { template<__SIZE_TYPE__ N> S(int (&)[N]); };
        struct T { int a; S b; };
        int a[] = { 1 };
        T t = { 1, a };

    This was fixed by f85e1317f8ea933f5c615680353bd646f480f7d3
    (PR 16333 et al).

    This patch tries to add a minimally-invasive workaround.

    gcc/ada/
            * gcc-interface/utils.cc (gnat_internal_attribute_table): Add extra
            braces to work around PR 16333 in older compilers.

    gcc/
            * attribs.cc (handle_ignored_attributes_option): Add extra
            braces to work around PR 16333 in older compilers.
            * config/aarch64/aarch64.cc (aarch64_gnu_attribute_table):
Likewise.
            (aarch64_arm_attribute_table): Likewise.
            * config/arm/arm.cc (arm_gnu_attribute_table): Likewise.
            * config/i386/i386-options.cc (ix86_gnu_attribute_table): Likewise.
            * config/ia64/ia64.cc (ia64_gnu_attribute_table): Likewise.
            * config/rs6000/rs6000.cc (rs6000_gnu_attribute_table): Likewise.
            * target-def.h (TARGET_GNU_ATTRIBUTES): Likewise.
            * genhooks.cc (emit_init_macros): Likewise, when emitting the
            instantiation of TARGET_ATTRIBUTE_TABLE.
            * langhooks-def.h (LANG_HOOKS_INITIALIZER): Likewise, when
            instantiating LANG_HOOKS_ATTRIBUTE_TABLE.
            (LANG_HOOKS_ATTRIBUTE_TABLE): Define to be empty by default.
            * target.def (attribute_table): Likewise.

    gcc/c-family/
            * c-attribs.cc (c_common_gnu_attribute_table): Add extra
            braces to work around PR 16333 in older compilers.

    gcc/c/
            * c-decl.cc (std_attribute_table): Add extra braces to work
            around PR 16333 in older compilers.

    gcc/cp/
            * tree.cc (cxx_gnu_attribute_table): Add extra braces to work
            around PR 16333 in older compilers.

    gcc/d/
            * d-attribs.cc (d_langhook_common_attribute_table): Add extra
braces
            to work around PR 16333 in older compilers.
            (d_langhook_gnu_attribute_table): Likewise.

    gcc/fortran/
            * f95-lang.cc (gfc_gnu_attribute_table): Add extra braces to work
            around PR 16333 in older compilers.

    gcc/jit/
            * dummy-frontend.cc (jit_gnu_attribute_table): Add extra braces
            to work around PR 16333 in older compilers.
            (jit_format_attribute_table): Likewise.

    gcc/lto/
            * lto-lang.cc (lto_gnu_attribute_table): Add extra braces to work
            around PR 16333 in older compilers.
            (lto_format_attribute_table): Likewise.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-05 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02 18:59 [Bug c++/16333] New: More array vs ptr stuff bangerth at dealii dot org
2004-07-02 19:02 ` [Bug c++/16333] " pinskia at gcc dot gnu dot org
     [not found] <bug-16333-4@http.gcc.gnu.org/bugzilla/>
2023-12-05 17:54 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).