Are noexcept specifiers accepted in function typedefs?
as in:
typedef void (*fptr)() noexcept;
Intuitively, noexcept specifiers seem to make sense since they would allow some optimisations at the caller's side.
I got a mixed answer from gcc 4.6.1.
typedef void (*fptr)() noexcept;
results in: error: ‘fptr’ declared with an exception specification
but:
template<void (*FPtr)() noexcept>
struct A{};
compiles without warning.
clang gives:
This is backed up in the C++11 standard in 15.4 [except.spec]/p2: