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

            Bug ID: 48339
           Summary: Bogus error/note about dependent base classes on
                    template instantiation failure
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: w...@cornell.edu
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

The below code is invalid (the template parameter of g cannot be deduced), but
before giving the correct error clang reports

bug.cpp:11:5: error: use of undeclared identifier 'g'
    g(typename T::type{});
    ^
    this->
bug.cpp:16:7: note: in instantiation of function template specialization
'S::f<X>' requested here
  S{}.f<X>();
      ^
bug.cpp:7:15: note: must qualify identifier to find this declaration in
dependent base class
  static void g(typename T::type) {}

which make no sense as there are no base classes here, dependent or otherwise. 
These messages are not present if g is not marked static.


struct X {
  struct type {};
};

struct S {
  template <typename T>
  static void g(typename T::type) {}

  template <typename T>
  void f() {
    g(typename T::type{});
  }
};

void f() {
  S{}.f<X>();
}

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

Reply via email to