== Why is this an issue?

``++#include_next++`` is a gcc-specific language extension that alters the search path for the specified header file by starting the search from the header file directory _after_ the one in which the directive was encountered. It also ignores the distinction between ``++"file"++`` and ``++<file>++``. It is typically used when you have two (probably related) header files with the same name, although there is nothing in the extension to enforce or limit the use to same-name files.


Use of this extension can be tricky to get right, and is almost never justified. Instead, you should use an absolute path in the ``++#include++`` statement or rename one of the files.


=== Noncompliant code example

[source,cpp]
----
#include_next "foo.h" // Noncompliant
----


=== Compliant solution

[source,cpp]
----
#include "/usr/local/include/foo.h"
----


ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Remove this use of "#include_next".


=== Highlighting

``++#include_next++``


'''
== Comments And Links
(visible only on this page)

=== on 27 Sep 2016, 15:51:04 Ann Campbell wrote:
\[~jeanchristophe.collet] please explain what ``++#include_next++`` does, and what should be used instead. Please also demonstrate that in a compliant solution

=== on 27 Sep 2016, 16:47:20 Ann Campbell wrote:
https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html

=== on 27 Sep 2016, 16:59:31 Ann Campbell wrote:
double-check me, please [~jeanchristophe.collet]

endif::env-github,rspecator-view[]
