jeudi 6 avril 2017

Whose bug is this - clang or gcc?

#include <regex>
#include <string>
#include <iostream>

using namespace std;

bool IsMatched()
{
    string str = R"(Liy_0-3863)";
    string re = R"([:\-_a-zA-Z\d]+)";

    auto flags = std::regex_constants::ECMAScript;
    return std::regex_match(str.data(),
        std::regex(re.data(), re.size(), flags));
}


int main()
{
    cout << boolalpha << IsMatched();
}

  • clang 4.0 outputs true;
  • gcc 6.2 outputs false.

Whose bug is this - clang or gcc?

Aucun commentaire:

Enregistrer un commentaire