Compile error when not using -ftree-ter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Consider the following code snippet:

    struct Foo
    {
        void foobar() {}
    };

    typedef void (*plain_foobar_t)(Foo*);

    void test()
    {
        asm("push %0;"
            :
            : "i"((plain_foobar_t)&Foo::foobar));
    }

    int main(){}

If I compile this with

    g++ -Wno-pmf-conversions main.cpp

I get the following;

    main.cpp: In function ‘void test()’:
    main.cpp:12: warning: asm operand 0 probably doesn’t match constraints
    main.cpp:12: error: impossible constraint in ‘asm’

However, if I compile it with

    g++ -Wno-pmf-conversions -ftree-ter main.cpp

all is fine.

Should I file a bug about this or is this somehow wanted behavior? If so, could 
anybody explain what the problem is?

Thanks in advance,
Job



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux