The commands C-xC-e were issued within the *info* buffer.
After positioning point within the sample function definition,
and issuing C-c=, the erroneous behaviour, as described, occurred.

However, copying the two functions and the global key setting and
the sample function to the *scratch* buffer and then setting point
into the sample function definition and keying C-c= produced the
correct result: There are 10 words or symbols... Point was set to the
character beyond the function definition.
-- 
Sian Mountbatten (home web-site http://www.poenikatu.co.uk/>)
Learning C++11 from the C++ Primer 5th edition.
I'm an associate FSF member (no. 10888).
Help us support software freedom! http://www.fsf.org/jf?referrer=10888