[Bug c++/58848] constexpr function allows throw

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 30 14:58:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58848

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The initializer for ReferenceElement<RefElType::POINT>::v calls the function in
a constant expression, but G++ doesn't diagnose it unless you instantiate that
member.

You get an error if you do:

int main() {
  return ReferenceElement<RefElType::POINT>::v;
}



More information about the Gcc-bugs mailing list