This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Compile error when not using -ftree-ter
- From: Job Noorman <jobnoorman at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 15 Aug 2010 18:23:40 +0200
- Subject: Compile error when not using -ftree-ter
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