Hide Forgot
Description of problem: brings up error on TutorialsPoint C++ Compiler, found at http://www.tutorialspoint.com/compile_cpp11_online.php. Instructions in error specified to go to http://bugzilla.redhat.com/bugzilla to find instructions Version-Release number of selected component (if applicable):?? How reproducible: just trying to run a regex program. Code: ----------------------------------------- //Example 1 #include <iostream> #include <regex> #include <string> using namespace std; int main() { string input; regex integer("(\\+|-)?[[:digit:]]+"); //As long as the input is correct ask for another number while(true) { cout<<"Give me an integer!"<<endl; cin>>input; if(!cin) break; //Exit when the user inputs q if(input=="q") break; if(regex_match(input,integer)) cout<<"integer"<<endl; else { cout<<"Invalid input"<<endl; } } } ---------------------------- Steps to Reproduce: 1. copy & paste code from middle of page on https://solarianprogrammer.com/2011/10/12/cpp-11-regex-tutorial/, code is titled "regex_01.cpp" 2. compile code on TutorialsPoint at http://www.tutorialspoint.com/compile_cpp11_online.php (by pressing the "Compile" button) 3. Wait & wait & watch error message Actual results: sh-4.3$ g++ -std=c++11 -o main *.cpp g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. sh-4.3$ Expected results: "Give me an integer!" with cin for input cout Either "integer" or "Invalid input" Additional info: beginning C++ class, just trying to find a way to validate input with regular expressions.
Hi, You'll need to talk to tutorialspoint and ask them to upgrade their compilers. This code sample works on g++ 5.3.1-6