public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95610] New: GCC fails to get global variable via "::" in class specifier
@ 2020-06-09 17:22 haoxintu at gmail dot com
  2020-06-09 20:45 ` [Bug c++/95610] bogus error: "global qualification of class name is invalid" redi at gcc dot gnu.org
  2021-12-07  4:58 ` [Bug c++/95610] GCC rejects class definition with a global qualification pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: haoxintu at gmail dot com @ 2020-06-09 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95610
           Summary: GCC fails to get global variable via "::" in class
                    specifier
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

This case test.cc

class s;
class ::s { } ss;

$g++ -c test.cc
test.cc:2:11: error: global qualification of class name is invalid before ‘{’
token
    2 | class ::s {int a;} ss;
      | 

GCC fails to compile this c++ code, replacing "class" with "struct" or "union"
also reproduces above result.

Also, if test.cc removes "::", GCC compiles it well. 

I also tested test.cc in clang, icc, or msvc, and they compile it successfully.

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

* [Bug c++/95610] bogus error: "global qualification of class name is invalid"
  2020-06-09 17:22 [Bug c++/95610] New: GCC fails to get global variable via "::" in class specifier haoxintu at gmail dot com
@ 2020-06-09 20:45 ` redi at gcc dot gnu.org
  2021-12-07  4:58 ` [Bug c++/95610] GCC rejects class definition with a global qualification pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2020-06-09 20:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|GCC fails to get global     |bogus error: "global
                   |variable via "::" in class  |qualification of class name
                   |specifier                   |is invalid"
           Keywords|                            |rejects-valid
   Last reconfirmed|                            |2020-06-09
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This has nothing to do with global variables, it's a class definition. THis
produces the same error, with no variables involved:

class s;
class ::s { };

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

* [Bug c++/95610] GCC rejects class definition with a global qualification
  2020-06-09 17:22 [Bug c++/95610] New: GCC fails to get global variable via "::" in class specifier haoxintu at gmail dot com
  2020-06-09 20:45 ` [Bug c++/95610] bogus error: "global qualification of class name is invalid" redi at gcc dot gnu.org
@ 2021-12-07  4:58 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-07  4:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 66892.

*** This bug has been marked as a duplicate of bug 66892 ***

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

end of thread, other threads:[~2021-12-07  4:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09 17:22 [Bug c++/95610] New: GCC fails to get global variable via "::" in class specifier haoxintu at gmail dot com
2020-06-09 20:45 ` [Bug c++/95610] bogus error: "global qualification of class name is invalid" redi at gcc dot gnu.org
2021-12-07  4:58 ` [Bug c++/95610] GCC rejects class definition with a global qualification 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).