I may have found a bug in GCC 5.4.0 and 6.1.1.
Consider the following program:
I receive the following error.Code:class foo { public: void Bar() {} }; foo operator""_FOO(long double ld) { return foo(); } foo operator""_FOO(unsigned long long int) { return foo(); } int main() { 3.14_FOO.Bar(); 1234_FOO.Bar(); return 0; }
It appears to be treating the '.Bar' portion as if it were part of the literal operator. If I add a space after the literal operator, it compiles without errors.Code:main.cpp: In function ‘int main()’: main.cpp:19:3: error: unable to find numeric literal operator ‘operator""_FOO.Bar’ 3.14_FOO.Bar(); ^ main.cpp:20:3: error: unable to find numeric literal operator ‘operator""_FOO.Bar’ 1234_FOO.Bar(); ^
The only active GCC bug I can find that seems related is this one: botched floating-point UDL
Is this correct behavior, or have I discovered a bug?