https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93614
Bug ID: 93614 Summary: C++ compile error with struct in template class and < operator Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: thilo.voert...@coseda-tech.com Target Milestone: --- The following code does not compile. which I consider a compiler bug: template<class T> class foo{}; template<class T> class template_class_with_struct { void my_method() { if(this->b.foo < 1); }; struct bar { long foo; } b; }; It returns the following error message is returned: error: type/value mismatch at argument 1 in template parameter list for 'template<class T> class foo' 8 | if(this->b.foo < 1); | ^ The creation of template class foo leads to this error, it can be worked around by writing b.bar::foo or parenthesis ((this->b.foo) < 1) in the error line, however it should not be neccessary. Note: MSVC accepts this this code without complaining