https://bugs.llvm.org/show_bug.cgi?id=38299

            Bug ID: 38299
           Summary: non-dependent name treated as if it were dependent,
                    requiring use of template keyword
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: zhong...@pku.org.cn
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

This example fails to compile on the marked line, but nothing here is
dependent. 


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>;

The error message is:

error: use 'template' keyword to treat 'foo' as a dependent template name
     result.foo<void>(); // (*)
            ^
            template 
    1 error generated.

BTW, g++ accepts the code.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to