When I attempt compiling the following code I get a linker error: Undefined symbols for architecture x86_64: \"Foo()\", referenced from: _main in main.o using L
It's an interesting question. As Andy Prowl, constexpr makes
the function inline, which means that there must be
a definition of it in every translation unit which uses it;
I would have expected an error from the compiler. (Actually, if
I read §3.2/5 correctly, a diagnostic is required if you use the
function and there is no definition.)
As to why const has different behavior: you can't mark
a non-menber function const. If you write const int Foo();,
it is not the function which is const, but the type it returns
(except that if the return type is not a class type,
cv-qualifiers are ignored, so this is really the same as int
Foo();).