[Bug c++/56235] New: [4.8 regression] Bogus "error:=?UTF-8?Q?=20invalid=20conversion=20from=20=E2=80=98unsigned=20char=E2=80=99=20to=20=E2=80=98B?=::=?UTF-8?Q?Mode=E2=80=99=20?=[-fpermissive]"

ppluzhnikov at google dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 7 05:16:00 GMT 2013


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

             Bug #: 56235
           Summary: [4.8 regression] Bogus "error: invalid conversion from
                    ‘unsigned char’ to ‘B::Mode’ [-fpermissive]"
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ppluzhnikov@google.com


Test case:

struct A
{
    A (const A &);
};

struct B
{
    A a;
    enum Mode { };
    Mode m:8;
};

struct C
{
    C();
    B b;
};

C fn()
{
    return C();
}


The test compiles fine with 4.7, fails with 4.8 (20130205 (experimental)) but
only in C++11 mode:

g++ -c -std=c++11 t.ii
t.ii: In constructor ‘B::B(B&&)’:
t.ii:6:8: error: invalid conversion from ‘unsigned char’ to ‘B::Mode’
[-fpermissive]
 struct B
        ^
t.ii: In constructor ‘C::C(C&&)’:
t.ii:13:8: note: synthesized method ‘B::B(B&&)’ first required here 
 struct C
        ^
t.ii: In function ‘C fn()’:
t.ii:21:14: note: synthesized method ‘C::C(C&&)’ first required here 
     return C();
              ^


Google ref: b/8152830



More information about the Gcc-bugs mailing list