https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78623

            Bug ID: 78623
           Summary: non-dependent name treated as if it were dependent,
                    requiring use of template keyword
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

This example fails to compile on the marked line - gcc requires me to write
result.template foo<void>(), which shouldn't be necessary. Nothing here is
dependent. 

If I declared result as an X rather than with auto, the code compiles fine.

struct X { 
    template <class T>
    void foo();
};

struct Base {
    X get();
};

template <class >
struct Derived : Base
{
    void foo() {
        auto result = Base::get();
        result.foo<void>(); // (*)
    }   
};

template struct Derived<int>;

Reply via email to