should the inline keyword prevent code compilation with no optimization?

Ian Lance Taylor iant@google.com
Tue Sep 8 23:49:00 GMT 2009


Rohit Garg <rpg.314@gmail.com> writes:

> I have a small c++ test class. Many of the functions are declared
> inline and are declared and defined inside the class definition
> itself. The code refuses to compile without optimization, but compiles
> and executes correctly with -O{s,1,2,3}.
>
> Is this expected?

No.

I can't recreate your problem--your test case compiles when I try it.

> vector8s.cpp:13: error: no matching function for call to
> ‘vector8s::first4(long long int __vector__*)’
> vector8s.h:100: note: candidates are: void vector8s::first4(int*) const

Clearly there is some confusion somewhere between __m128i* and int*, but
I don't know what could cause that.

Ian



More information about the Gcc-help mailing list