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

            Bug ID: 62264
           Summary: std::experimental::string_view won't compile with
                    -pedantic-errors
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnozicka at gmail dot com

std::experimental::string_view won't compile with -pedantic-errors


SOURCE:
#include <experimental/string_view>

int main()
{
    return 0;
}


COMPILE OK: (this works)
/opt/szn/bin/g++-4.9 -std=c++14  -Wall -Wextra -o program main.cpp

COMPILE ERROR:
/opt/szn/bin/g++-4.9 -std=c++14 -pedantic-errors -Wall -Wextra -o program
main.cpp

results in:

In file included from /opt/szn/include/c++/4.9/experimental/string_view:704:0,
                 from main.cpp:1:
/opt/szn/include/c++/4.9/experimental/string_view.tcc:56:69: error: declaration
of ‘std::experimental::basic_string_view<_CharT, _Traits>::size_type
std::experimental::basic_string_view<_CharT, _Traits>::find(const _CharT*,
std::experimental::basic_string_view<_CharT, _Traits>::size_type,
std::experimental::basic_string_view<_CharT, _Traits>::size_type) const
noexcept’ has a different exception specifier
     find(const _CharT* __str, size_type __pos, size_type __n) const noexcept
                                                                     ^
In file included from main.cpp:1:0:
/opt/szn/include/c++/4.9/experimental/string_view:332:7: error: from previous
declaration ‘std::experimental::basic_string_view<_CharT, _Traits>::size_type
std::experimental::basic_string_view<_CharT, _Traits>::find(const _CharT*,
std::experimental::basic_string_view<_CharT, _Traits>::size_type,
std::experimental::basic_string_view<_CharT, _Traits>::size_type) const’
       find(const _CharT* __str, size_type __pos, size_type __n) const;
       ^
In file included from /opt/szn/include/c++/4.9/experimental/string_view:704:0,
                 from main.cpp:1:
/opt/szn/include/c++/4.9/experimental/string_view.tcc:93:70: error: declaration
of ‘std::experimental::basic_string_view<_CharT, _Traits>::size_type
std::experimental::basic_string_view<_CharT, _Traits>::rfind(const _CharT*,
std::experimental::basic_string_view<_CharT, _Traits>::size_type,
std::experimental::basic_string_view<_CharT, _Traits>::size_type) const
noexcept’ has a different exception specifier
     rfind(const _CharT* __str, size_type __pos, size_type __n) const noexcept
                                                                      ^
In file included from main.cpp:1:0:
/opt/szn/include/c++/4.9/experimental/string_view:346:7: error: from previous
declaration ‘std::experimental::basic_string_view<_CharT, _Traits>::size_type
std::experimental::basic_string_view<_CharT, _Traits>::rfind(const _CharT*,
std::experimental::basic_string_view<_CharT, _Traits>::size_type,
std::experimental::basic_string_view<_CharT, _Traits>::size_type) const’
       rfind(const _CharT* __str, size_type __pos, size_type __n) const;
       ^



GCC configuration:
Using built-in specs.
COLLECT_GCC=/opt/szn/bin/g++-4.9
COLLECT_LTO_WRAPPER=/opt/szn/lib/gcc/x86_64-linux-gnu/4.9.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: /home/tomas/packages/gcc/gcc-4.9.1/configure --prefix=/opt/szn
--program-suffix=-4.9 --enable-languages=c++ --disable-multilib --enable-shared
--enable-threads=posix --enable-checking=release --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --with-tune=generic
--enable-libstdcxx-time=yes --enable-libstdcxx-debug
--enable-version-specific-runtime-libs --enable-objc-gc --enable-clocale=gnu
--disable-install-libiberty --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu --libdir=/opt/szn/lib --libexecdir=/opt/szn/lib
--infodir=/opt/szn/share/info-gcc-4.9 --localedir=/opt/szn/share/locale-gcc-4.9
--mandir=/opt/szn/share/man-gcc-4.9
--with-gxx-include-dir=/opt/szn/include/c++/4.9
Thread model: posix
gcc version 4.9.1 (GCC)

Reply via email to