Using #include "..." to include a header in the same directory fails if
the user compiles with -I-, so always use something like <bits/...> for
internal headers.

I haven't added tests for this, because dg-options adds options to the
end, and the position of -I- matters (if it's at the end then the tests
won't find any headers in the build tree, as they're specified by -I
options earlier in the flags). It's been manually tested though.

        PR libstdc++/88066
        * include/bits/locale_conv.h: Use <> for includes not "".
        * include/ext/random: Likewise.
        * include/ext/vstring.h: Likewise.

Apparently I never sent this to the mailing lists. It was committed to
trunk a month ago, and now to gcc-8-branch too.


commit 9441a76de071a91258f5eee27b55779822ab842b
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Sat Feb 9 00:40:31 2019 +0000

    PR libstdc++/88066 use <> for includes not ""
    
    Using #include "..." to include a header in the same directory fails if
    the user compiles with -I-, so always use something like <bits/...> for
    internal headers.
    
    I haven't added tests for this, because dg-options adds options to the
    end, and the position of -I- matters (if it's at the end then the tests
    won't find any headers in the build tree, as they're specified by -I
    options earlier in the flags). It's been manually tested though.
    
            PR libstdc++/88066
            * include/bits/locale_conv.h: Use <> for includes not "".
            * include/ext/random: Likewise.
            * include/ext/vstring.h: Likewise.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-8-branch@268714 
138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libstdc++-v3/include/bits/locale_conv.h 
b/libstdc++-v3/include/bits/locale_conv.h
index bc5669f2521..72680b94030 100644
--- a/libstdc++-v3/include/bits/locale_conv.h
+++ b/libstdc++-v3/include/bits/locale_conv.h
@@ -35,10 +35,10 @@
 #else
 
 #include <streambuf>
-#include "stringfwd.h"
-#include "allocator.h"
-#include "codecvt.h"
-#include "unique_ptr.h"
+#include <bits/stringfwd.h>
+#include <bits/allocator.h>
+#include <bits/codecvt.h>
+#include <bits/unique_ptr.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random
index 0a98b350925..8ae3bde777b 100644
--- a/libstdc++-v3/include/ext/random
+++ b/libstdc++-v3/include/ext/random
@@ -3778,8 +3778,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace __gnu_cxx
 
-#include "ext/opt_random.h"
-#include "random.tcc"
+#include <ext/opt_random.h>
+#include <ext/random.tcc>
 
 #endif // _GLIBCXX_USE_C99_STDINT_TR1 && UINT32_C
 
diff --git a/libstdc++-v3/include/ext/vstring.h 
b/libstdc++-v3/include/ext/vstring.h
index 605311e9a28..e45e774e825 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -2962,6 +2962,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
 
 #endif // C++11
 
-#include "vstring.tcc" 
+#include <ext/vstring.tcc>
 
 #endif /* _VSTRING_H */

Reply via email to