public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51214] New: [C++11] name lookup issue with c++11 enums
@ 2011-11-18 20:21 fabien at gcc dot gnu.org
  2011-11-18 20:33 ` [Bug c++/51214] " fabien at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: fabien at gcc dot gnu.org @ 2011-11-18 20:21 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51214
           Summary: [C++11] name lookup issue with c++11 enums
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: fabien@gcc.gnu.org


Noticed while working on PR c++/51188, I have launched the c++ testsuite with
the patch below:
Index: class.c
===================================================================
--- class.c    (revision 181491)
+++ class.c    (working copy)
@@ -6007,7 +6007,7 @@ finish_struct_1 (tree t)
      hierarchy), and we want this failure to occur quickly.  */

   n_fields = count_fields (TYPE_FIELDS (t));
-  if (n_fields > 7)
+  if (n_fields > 0)

And it has raised two errors related to c++11 enums: forw_enum5.C and
forw_enum9.C. Thus, here is a reproducer, comming from forw_enum5.C:

// { dg-do compile }
// { dg-options "-std=c++0x" }

namespace one
{
    struct S
    {
        enum { A = 1, B = 2 };
        struct T
        {
        int i1, i2, i3, i4, i5, i6, i7;

            enum { B = 102 };

            enum class E1;
            enum E2 : int;
        };
    };

    static_assert(int(S::T::A1) == 1, "error");
    static_assert(int(S::T::B1) == 102, "error");
    static_assert(int(S::T::C1) == 103, "error");
}

The following errors are issued:

error: 'A1' is not a member of 'one::S::T'

error: 'B1' is not a member of 'one::S::T'

error: 'C1' is not a member of 'one::S::T'


Most likely an issue in the sorted case of lookup_field_1. Mine.


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

end of thread, other threads:[~2012-06-27 17:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-18 20:21 [Bug c++/51214] New: [C++11] name lookup issue with c++11 enums fabien at gcc dot gnu.org
2011-11-18 20:33 ` [Bug c++/51214] " fabien at gcc dot gnu.org
2011-12-29 20:56 ` fabien at gcc dot gnu.org
2012-02-28 20:21 ` [Bug c++/51214] [4.7 Regression] " fabien at gcc dot gnu.org
2012-04-05 10:56 ` [Bug c++/51214] [4.7/4.8 " rguenth at gcc dot gnu.org
2012-04-13 12:54 ` rguenth at gcc dot gnu.org
2012-06-07  5:36 ` fabien at gcc dot gnu.org
2012-06-07 19:53 ` [Bug c++/51214] [4.7 " jason at gcc dot gnu.org
2012-06-14  8:31 ` rguenth at gcc dot gnu.org
2012-06-27 17:37 ` fabien at gcc dot gnu.org
2012-06-27 17:53 ` fabien 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).