[Bug c++/89870] C++ suggest header for abort()

jg at jguk dot org gcc-bugzilla@gcc.gnu.org
Thu Mar 28 15:02:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89870

--- Comment #2 from Jonny Grant <jg at jguk dot org> ---
Good point!

Any header would be a good start... but as it is a CPP file being compiled by
g++ perhaps g++ should even suggest std::abort() and <cstdlib> ?


eg suggestion:
test.cpp: In function 'int main()':
test.cpp:3:5: error: 'abort' was not declared in this scope
    3 |     abort();
      |     ^~~~~
note: did you mean std::abort?
note: include '<cstdlib>' or provide a declaration of 'abort'
  +++ |+#include <cstdlib>


More information about the Gcc-bugs mailing list