JustasMasiulis / xorstr

heavily vectorized c++17 compile time string encryption.
Apache License 2.0
1.19k stars 193 forks source link

Compilation error with class and template #43

Closed kotori2 closed 3 years ago

kotori2 commented 3 years ago

Compiler: Apple clang version 12.0.5 (clang-1205.0.22.11) Test case:

template<typename T>
class Test{
private:
    void t() {
        std::puts(xorstr_("TEST"));
    }
};

Error:

/[REDACTED]/main.cpp:26:19: error: member reference base type '::jm::xor_string' is not a structure or union
        std::puts(xorstr_("TEST"));
                  ^~~~~~~~~~~~~~~
/[REDACTED]/xorstr.hpp:34:33: note: expanded from macro 'xorstr_'
#define xorstr_(str) xorstr(str).crypt_get()
                     ~~~~~~~~~~~^~~~~~~~~~
kotori2 commented 3 years ago

Okay it seems like a Clang bug. Switching to Clang 12 (instead of Apple Clang 12) solves the issue.