http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58848
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler@googlemail.
| |com
--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
I cannot follow your argumentation for constexp_error.cpp: The main function
invokes
ReferenceElement<RefElType::POINT>::numSubEntities(7)
This function is declared as
static inline unsigned numSubEntities(int codim) {
return typeTraits_<RefElType::POINT>::numSubEntities(codim);
}
Note in particular that this is *not* a constexpr function. Now it delegates to
typeTraits_<RefElType::POINT>::numSubEntities, which is defined as:
static constexpr unsigned numSubEntities(int codim) {
return codim==0 ? 11 : throw 20;
}
This is a constexpr function, but it is not called with constant arguments that
require the evaluation of this function in a constexpr context. Thus, throwing
an exception is valid here.
So what is the problem?