Open mclow opened 8 years ago
I get this issue with a function template which is not being invoked or instantiated either implicitly or explicitly even with -fdelayed-template-parsing
. This is the only part of my source code which seems to cause this issue, I use the technique of separating exception generating code ('Safe' versions) throughout the library yet only this header seems to cause the issue for some unknown (to me) reason.
While compiling this file:
https://github.com/ASA1976/RAP-BTL/blob/20575d451cef6c66a72384d1b49f09fe1441cadd/invocation.cpp
This header causes the error:
https://github.com/ASA1976/RAP-BTL/blob/20575d451cef6c66a72384d1b49f09fe1441cadd/abstraction.hpp
And this header is also required to compile that particular source file:
https://github.com/ASA1976/RAP-BTL/blob/20575d451cef6c66a72384d1b49f09fe1441cadd/location.hpp
or what the standard(s) say about it, though.
I'm pretty sure that the standard says nothing about compiling with exceptions off.
If you use -fdelayed-template-parsing
, this example will work. I do not know whether this is intentional or not, or what the standard(s) say about it, though. :-)
Extended Description
I ran into this in the libc++ test suite.
If
-fno-exceptions
is defined, the following code compiles w/o error using GCC, but gets an error with clang.My expectation matches gcc's behavior; no error should be generated unless/until the template is instantiated.
Reproducer: