Edit: It looks like I incorrectly inserted the code in Como, or it was edited in the original answer to be correct. In any case, I keep the answer below as if the code was incorrect.
The Comeau online compiler produces the following results:
"ComeauTest.c", line 4: error: enter the qualifier specified more than once
const char const * const GetName () {return m_name; } const; ^
"ComeauTest.c", line 4: warning: enter a qualifier by return type meaningless const char const * const GetName () {return m_name; } const; ^
"ComeauTest.c", line 4: error: declaration declares nothing const char const * const GetName () {return m_name; } const;
This means that your statement is incorrect.
const char const * const GetName() { return m_name; } const;
The first and second constants mean the same thing. You cannot specify the same qualifier more than once, so that one of them had to be removed to compile the code. Both of these constants indicate that the values pointed to by the pointer returned by GetName cannot be changed, which makes such code invalid:
const char* name = c.GetName(); name[0] = 'a';
The third const indicates that the pointer returned by GetName () itself cannot be changed, but, as Como points out, it does nothing on the return value, since the return value is a copy of the pointer, not the pointer, and can be assigned to a non-continent pointer.
The fourth constant is inappropriate; it should be between GetName and the function body as follows:
const char* GetName() const { return m.name; }
This constant indicates that no members of the class will be changed during GetName. Assuming GetName is a member of the Person class, this code will be resolved:
const Person& p; p.GetName();
Without this constant, the above code will not work.