Bug 68058 - _GLIBCXX_BEGIN_NAMESPACE_VERSION breaks regex
Summary: _GLIBCXX_BEGIN_NAMESPACE_VERSION breaks regex
Status: RESOLVED DUPLICATE of bug 77794
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 5.2.0
: P3 normal
Target Milestone: 5.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-22 21:21 UTC by Daniel Morilha
Modified: 2016-10-03 15:32 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
regex patch (837 bytes, patch)
2015-10-23 03:02 UTC, Daniel Morilha
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Morilha 2015-10-22 21:21:25 UTC
when compiling libstdc++ with --enable-symvers=gnu-versioned-namespace std::regex complaining about private data members trying to be accessed outside the class:

22:55:46 /home/y/include/c++/4.9.2/bits/regex.h:796:30: error: ‘std::__7::basic_regex<char>::_AutomatonPtr std::__7::basic_regex<char>::_M_automaton’ is protected
22:55:46        _AutomatonPtr          _M_automaton;

I believe the bug is related with the __detail namespace[1] and friend classes[2] as it lacks the NAMESPACE_VERSION expansion. This happens in other lines and I believe it extends to hashmap as well. Turning data members public "fixes" the compilation problem.

[1]: https://github.com/gcc-mirror/gcc/blob/e0f174323b4297f46d9109201666da42aaa55fc8/libstdc%2B%2B-v3/include/bits/regex.h#L46

[2]: https://github.com/gcc-mirror/gcc/blob/e0f174323b4297f46d9109201666da42aaa55fc8/libstdc%2B%2B-v3/include/bits/regex.h#L772
Comment 1 Daniel Morilha 2015-10-23 03:02:05 UTC
Created attachment 36564 [details]
regex patch
Comment 2 Jonathan Wakely 2016-10-03 15:32:27 UTC
This is due to PR 59256, but is now fixed by the changes for PR 77794.

*** This bug has been marked as a duplicate of bug 77794 ***