Commenting out some lines of never executed function definition fixes it though. How come?

Full minimal example I've ended up with while deleting unrelated code below.

```
int main() {
    auto tList = tokenize();
    tList.front()->~Token();  //hangs forever if the code 10 lines above is not commented, normally I'll have pop_front() here
    cout << "never gets printed";
    return 0;
}

```

Normally I'll have

```
tList.pop_front() 

```

instead of 

```
tList.front()->~Token();

```

it's here just to demonstrate it more explicitly

Promised code: (also on <https://gist.github.com/anonymous/3b8fa11e90c617b35623ba5432050c3e#file-main-cpp-L68>)
tokenizer.h

```
#include <list>
#include <memory>

using namespace std;

#ifndef SGREP_TOKENIZER_H
#define SGREP_TOKENIZER_H

class Token {
public:
    virtual ~Token() = default;

    virtual bool isChar() const {
        return false;
    }

};

using TTokenList = list<unique_ptr<Token>>;

TTokenList tokenize ();

#endif //SGREP_TOKENIZER_H

```

tokenizer.cpp

```
#include <iostream>
#include <cctype>
#include <string>

#include "tokenizer.h"

using namespace std;

class Char : public Token {
    char value;
public:
    Char (char value) : value(value){};

    bool isChar() const override {
        return true;
    }

};

TTokenList tokenize () {
    TTokenList tList;

    tList.push_back(make_unique<Char>('h'));

    return tList;
}

```

main.cpp

```
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include <exception>

#include "tokenizer.h"

using namespace std;

class SyntaxError : public exception {};

class Regex {
public:
    virtual size_t match_part(const string& str, size_t begin, size_t maxLen, vector<size_t>& groups) = 0;  // groups is a vector of begin,end indices of matched groups (ParenRegexes) (to be able to recreate substrings)
    virtual ~Regex() = default;
};

class Char : public Regex  {
protected:
    vector<char> characterRanges;  // pairs -> lower and upper inclusive bound of matching a character (even lower, odd upper), size is always divisible by 2
public:
    Char(TTokenList& t, size_t& groupCount) {}

    size_t match_part(const string& str, size_t begin, size_t maxLen, vector<size_t>& groups) override {
        return 1;
    }
};

class SeqRegex: public Regex {
    unique_ptr<Regex> a;
public:
    SeqRegex(TTokenList& t, size_t& groupCount);

    size_t match_part(const string& str, size_t begin, size_t maxLen, vector<size_t>& groups) override {  // maxLen by nemelo byt 0:
        return 1;
    }
};

class OrRegex: public Regex {
    SeqRegex a;
public:
    OrRegex(TTokenList& t, size_t& groupCount) : a(t, groupCount) {}

    size_t match_part(const string& str, size_t begin, size_t maxLen, vector<size_t>& groups) override {
        return 1;
    }
};

SeqRegex::SeqRegex(TTokenList& t, size_t& groupCount) {
    if (t.front()->isChar()) {    // Commenting out this portion of code fixes the forever hanging ..
        a = make_unique<Char>(t, groupCount);
    } else {
        cerr << "syntax error, expected [^)]-*^|]" << endl;
        throw SyntaxError();
    }  // ...commenting out up to this point

}

int main() {
    auto tList = tokenize();
    tList.front()->~Token();  //hangs forever if the code 10 lines above is not commented, normally I'll have pop_front() here
    cout << "never gets printed";

    return 0;
}

```