[Bug libstdc++/82513] New: regex [z\-a] fails to compile

2017-10-10 Thread gene at genethomas dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82513

Bug ID: 82513
   Summary: regex [z\-a] fails to compile
   Product: gcc
   Version: 5.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gene at genethomas dot com
  Target Milestone: ---

The regex [z\-a] fails to compile in  and throws a regex_error. It seems
to be interpreting the \- as a - and thinking the z-a range is invalid. Sample
program below:

#include 
#include 
#include 

using namespace std;

int main(int argc, char **argv) {

try {
regex::flag_type flags = regex::ECMAScript;
regex theRegex("[z\\-a]", flags);
cout << "ok\n";
return 0;
} catch (exception &e) {
cerr << "fatal error: " << e.what() << "\n";
return 1;
}
}

[Bug c++/82821] New: g++ states that ctor of class is inaccessible just because I have inherited privately from it

2017-11-03 Thread gene at genethomas dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82821

Bug ID: 82821
   Summary: g++ states that ctor of class is inaccessible just
because I have inherited privately from it
   Product: gcc
   Version: 5.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gene at genethomas dot com
  Target Milestone: ---

Created attachment 42541
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42541&action=edit
c++ source file that reproduces the error

Just because I have privately inherited from a class should not mean that it's
ctor is inaccessible to me.

g++ (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
(in Ubuntu Linux 16.04.3 LTS)

to reproduce:
g++ g++-base-inaccessible.cpp

output:
g++-base-inaccessible.cpp: In member function ‘void MyAnotherString::method()’:
g++-base-inaccessible.cpp:2:16: error: ‘class MyString MyString::MyString’ is
inaccessible
 class MyString {
^
g++-base-inaccessible.cpp:11:9: error: within this context
 MyString s; // fails