[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|7.4 |6.5

--- Comment #11 from Jonathan Wakely  ---
And 6.5

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

--- Comment #10 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 11:37:46 2018
New Revision: 265083

URL: https://gcc.gnu.org/viewcvs?rev=265083=gcc=rev
Log:
PR libstdc++/85098 add missing definitions for static constants

In C++11 and C++14 any odr-use of these constants requires a definition
at namespace-scope.  In C++17 they are implicitly inline and so the
namespace-scope redeclarations are redundant (and allowing them is
deprecated).

Backport from mainline
2018-05-18  Jonathan Wakely  

PR libstdc++/85098
* include/bits/regex.h [__cplusplus < 201703L] (basic_regex::icase)
(basic_regex::nosubs, basic_regex::optimize, basic_regex::collate)
(basic_regex::ECMAScript, basic_regex::basic, basic_regex::extended)
(basic_regex::awk, basic_regex::grep, basic_regex::egrep): Add
definitions.
* include/bits/regex_automaton.h (_NFA::_M_insert_state): Adjust
whitespace.
* testsuite/28_regex/basic_regex/85098.cc: New

Added:
branches/gcc-6-branch/libstdc++-v3/testsuite/28_regex/basic_regex/85098.cc
Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/bits/regex.h
branches/gcc-6-branch/libstdc++-v3/include/bits/regex_automaton.h

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-07-04 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

Jonathan Wakely  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.4

--- Comment #9 from Jonathan Wakely  ---
Fixed for 7.4 and 8.2

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-07-04 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

--- Comment #8 from Jonathan Wakely  ---
Author: redi
Date: Wed Jul  4 13:59:13 2018
New Revision: 262405

URL: https://gcc.gnu.org/viewcvs?rev=262405=gcc=rev
Log:
PR libstdc++/85098 add missing definitions for static constants

In C++11 and C++14 any odr-use of these constants requires a definition
at namespace-scope.  In C++17 they are implicitly inline and so the
namespace-scope redeclarations are redundant (and allowing them is
deprecated).

Backport from mainline
2018-05-18  Jonathan Wakely  

PR libstdc++/85098
* include/bits/regex.h [__cplusplus < 201703L] (basic_regex::icase)
(basic_regex::nosubs, basic_regex::optimize, basic_regex::collate)
(basic_regex::ECMAScript, basic_regex::basic, basic_regex::extended)
(basic_regex::awk, basic_regex::grep, basic_regex::egrep): Add
definitions.
* include/bits/regex_automaton.h (_NFA::_M_insert_state): Adjust
whitespace.
* testsuite/28_regex/basic_regex/85098.cc: New

Added:
branches/gcc-7-branch/libstdc++-v3/testsuite/28_regex/basic_regex/85098.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/bits/regex.h
branches/gcc-7-branch/libstdc++-v3/include/bits/regex_automaton.h

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-07-04 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

--- Comment #7 from Jonathan Wakely  ---
Author: redi
Date: Wed Jul  4 11:45:04 2018
New Revision: 262389

URL: https://gcc.gnu.org/viewcvs?rev=262389=gcc=rev
Log:
PR libstdc++/85098 add missing definitions for static constants

In C++11 and C++14 any odr-use of these constants requires a definition
at namespace-scope.  In C++17 they are implicitly inline and so the
namespace-scope redeclarations are redundant (and allowing them is
deprecated).

Backport from mainline
2018-05-18  Jonathan Wakely  

PR libstdc++/85098
* include/bits/regex.h [__cplusplus < 201703L] (basic_regex::icase)
(basic_regex::nosubs, basic_regex::optimize, basic_regex::collate)
(basic_regex::ECMAScript, basic_regex::basic, basic_regex::extended)
(basic_regex::awk, basic_regex::grep, basic_regex::egrep): Add
definitions.
* include/bits/regex_automaton.h (_NFA::_M_insert_state): Adjust
whitespace.
* include/bits/regex_compiler.tcc (__INSERT_REGEX_MATCHER): Add
braces around body of do-while.
* testsuite/28_regex/basic_regex/85098.cc: New

Added:
branches/gcc-8-branch/libstdc++-v3/testsuite/28_regex/basic_regex/85098.cc
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/include/bits/regex.h
branches/gcc-8-branch/libstdc++-v3/include/bits/regex_automaton.h
branches/gcc-8-branch/libstdc++-v3/include/bits/regex_compiler.tcc

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-05-18 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

--- Comment #6 from Jonathan Wakely  ---
Fixed on trunk but I'll keep this open as I plan to backport it.

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-05-18 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

--- Comment #5 from Jonathan Wakely  ---
Author: redi
Date: Fri May 18 16:14:04 2018
New Revision: 260371

URL: https://gcc.gnu.org/viewcvs?rev=260371=gcc=rev
Log:
PR libstdc++/85098 add missing definitions for static constants

In C++11 and C++14 any odr-use of these constants requires a definition
at namespace-scope.  In C++17 they are implicitly inline and so the
namespace-scope redeclarations are redundant (and allowing them is
deprecated).

PR libstdc++/85098
* include/bits/regex.h [__cplusplus < 201703L] (basic_regex::icase)
(basic_regex::nosubs, basic_regex::optimize, basic_regex::collate)
(basic_regex::ECMAScript, basic_regex::basic, basic_regex::extended)
(basic_regex::awk, basic_regex::grep, basic_regex::egrep): Add
definitions.
* include/bits/regex_automaton.h (_NFA::_M_insert_state): Adjust
whitespace.
* include/bits/regex_compiler.tcc (__INSERT_REGEX_MATCHER): Add
braces around body of do-while.
* testsuite/28_regex/basic_regex/85098.cc: New

Added:
trunk/libstdc++-v3/testsuite/28_regex/basic_regex/85098.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/regex.h
trunk/libstdc++-v3/include/bits/regex_automaton.h
trunk/libstdc++-v3/include/bits/regex_compiler.tcc

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-03-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

--- Comment #4 from Jonathan Wakely  ---
Untested fix:

--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -776,6 +776,37 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
   _AutomatonPtr_M_automaton;
 };

+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::icase;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::nosubs;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::optimize;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::collate;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::ECMAScript;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::basic;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::extended;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::awk;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::grep;
+  template
+constexpr regex_constants::syntax_option_type
+basic_regex<_Ch, _Tr>::egrep;
+
 #if __cpp_deduction_guides >= 201606
   template
 basic_regex(_ForwardIterator, _ForwardIterator,

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-03-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

--- Comment #3 from Jonathan Wakely  ---
Reduced:

#include 

void f(const std::regex_constants::syntax_option_type&) { }

int main() {
  f(std::regex::extended);
}

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-03-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

Jonathan Wakely  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org

--- Comment #2 from Jonathan Wakely  ---
Wow, I'm amazed nobody's noticed this bug before.

[Bug libstdc++/85098] undefined reference to std::regex::extended

2018-03-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85098

Richard Biener  changed:

   What|Removed |Added

   Keywords||link-failure
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-28
Version|unknown |7.3.1
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
-std=c++17 only works since GCC 7, pre-GCC 7 it fails the same way.  It also
works when optimization is enabled.