public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66159] New: bogus warning for alias-declaration using elaborated-type-specifier
@ 2015-05-15 13:04 redi at gcc dot gnu.org
  2020-05-26 15:55 ` [Bug c++/66159] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2015-05-15 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66159
           Summary: bogus warning for alias-declaration using
                    elaborated-type-specifier
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

struct X { };

typedef struct ::X x1;

using x2 = struct ::X;


t.cc:5:21: warning: declaration ‘struct X’ does not declare anything
 using x2 = struct ::X;
                     ^

The two forms should be equivalent.
>From gcc-bugs-return-486331-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 15 13:17:37 2015
Return-Path: <gcc-bugs-return-486331-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 361 invoked by alias); 15 May 2015 13:17:37 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 124955 invoked by uid 48); 15 May 2015 13:17:33 -0000
From: "arjen.markus895 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/50221] Allocatable string length fails with array assignment
Date: Fri, 15 May 2015 13:17:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.6.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: arjen.markus895 at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-50221-4-Knc3VtUHLn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-50221-4@http.gcc.gnu.org/bugzilla/>
References: <bug-50221-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-05/txt/msg01171.txt.bz2
Content-length: 1076

https://gcc.gnu.org/bugzilla/show_bug.cgi?idP221

Arjen Markus <arjen.markus895 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arjen.markus895 at gmail dot com

--- Comment #4 from Arjen Markus <arjen.markus895 at gmail dot com> ---
I had a probably related failure with the following program using 4.9.2 under
Cygwin.

The program:

! chk_alloc_string.f90 --
!     Check if allocatable-length strings work in principle
!
program chk_alloc_string
    implicit none

    character(len=:), dimension(:), allocatable :: strings
    integer :: i

    allocate( character(10):: strings(1:3) )

    !strings = [ "A", "C", "ABCDE", "V" ]
    strings = [ character(len=4) :: "A", "C", "ABCDE", "V" ]

    write(*,*) len(strings(1)), size(strings)
    write(*,'(a)') strings
end program chk_alloc_string

The output:

           4           4
ACAV
CAV
AV
V

where I expected:
           4           4
A
C
ABCD
V


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

* [Bug c++/66159] bogus warning for alias-declaration using elaborated-type-specifier
  2015-05-15 13:04 [Bug c++/66159] New: bogus warning for alias-declaration using elaborated-type-specifier redi at gcc dot gnu.org
@ 2020-05-26 15:55 ` redi at gcc dot gnu.org
  2020-05-26 16:21 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-05-26 15:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Target Milestone|---                         |11.0
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org

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

* [Bug c++/66159] bogus warning for alias-declaration using elaborated-type-specifier
  2015-05-15 13:04 [Bug c++/66159] New: bogus warning for alias-declaration using elaborated-type-specifier redi at gcc dot gnu.org
  2020-05-26 15:55 ` [Bug c++/66159] " redi at gcc dot gnu.org
@ 2020-05-26 16:21 ` redi at gcc dot gnu.org
  2020-05-27  9:47 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-05-26 16:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Hmm, my patch doesn't actually fix the bogus warning, it just makes it possible
to disable it. A front end wizard will need to fix the real bug.

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

* [Bug c++/66159] bogus warning for alias-declaration using elaborated-type-specifier
  2015-05-15 13:04 [Bug c++/66159] New: bogus warning for alias-declaration using elaborated-type-specifier redi at gcc dot gnu.org
  2020-05-26 15:55 ` [Bug c++/66159] " redi at gcc dot gnu.org
  2020-05-26 16:21 ` redi at gcc dot gnu.org
@ 2020-05-27  9:47 ` redi at gcc dot gnu.org
  2020-06-17 19:27 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-05-27  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Patch proposed:
https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546603.html

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

* [Bug c++/66159] bogus warning for alias-declaration using elaborated-type-specifier
  2015-05-15 13:04 [Bug c++/66159] New: bogus warning for alias-declaration using elaborated-type-specifier redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-05-27  9:47 ` redi at gcc dot gnu.org
@ 2020-06-17 19:27 ` cvs-commit at gcc dot gnu.org
  2020-06-17 19:28 ` redi at gcc dot gnu.org
  2021-08-04  3:26 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-17 19:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:d392babbeb6cb531ab8b1ec68fde9ffd36373a6e

commit r11-1459-gd392babbeb6cb531ab8b1ec68fde9ffd36373a6e
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jun 17 20:26:13 2020 +0100

    c++: Fix bogus "does not declare anything" warning (PR 66159)

    G++ gives a bogus warning for 'struct A; using B = struct ::A;'
    complaining that the elaborated-type-specifier doesn't declare anything.
    That's true, but it's not trying to declare struct ::A, just refer to it
    unambiguously. Do not emit the warning unless we're actually parsing a
    declaration.

    gcc/cp/ChangeLog:

            PR c++/66159
            * parser.c (cp_parser_elaborated_type_specifier): Do not warn
            unless in a declaration.

    gcc/testsuite/ChangeLog:

            PR c++/66159
            * g++.dg/warn/forward-inner.C: Check alias-declaration using
            elaborated-type-specifier.

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

* [Bug c++/66159] bogus warning for alias-declaration using elaborated-type-specifier
  2015-05-15 13:04 [Bug c++/66159] New: bogus warning for alias-declaration using elaborated-type-specifier redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-06-17 19:27 ` cvs-commit at gcc dot gnu.org
@ 2020-06-17 19:28 ` redi at gcc dot gnu.org
  2021-08-04  3:26 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-06-17 19:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed on master.

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

* [Bug c++/66159] bogus warning for alias-declaration using elaborated-type-specifier
  2015-05-15 13:04 [Bug c++/66159] New: bogus warning for alias-declaration using elaborated-type-specifier redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-06-17 19:28 ` redi at gcc dot gnu.org
@ 2021-08-04  3:26 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04  3:26 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rutsky.vladimir at gmail dot com

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 64259 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2021-08-04  3:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15 13:04 [Bug c++/66159] New: bogus warning for alias-declaration using elaborated-type-specifier redi at gcc dot gnu.org
2020-05-26 15:55 ` [Bug c++/66159] " redi at gcc dot gnu.org
2020-05-26 16:21 ` redi at gcc dot gnu.org
2020-05-27  9:47 ` redi at gcc dot gnu.org
2020-06-17 19:27 ` cvs-commit at gcc dot gnu.org
2020-06-17 19:28 ` redi at gcc dot gnu.org
2021-08-04  3:26 ` pinskia 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).