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

            Bug ID: 35377
           Summary: no diagnostic issued for invalid friend declaration
                    involving dependent member of the current
                    instantiation
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: richard-l...@metafoo.co.uk
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

Testcase (inspired by testcase for gcc.gnu.org/PR65157):

template<typename T> struct A {
  struct B;
  template<typename U> struct C;
};

template <typename T>
struct A<T>::B {
  template<typename U> void f();
};

template<typename T> template <typename U>
struct A<T>::C {
 friend void B::f<U>();
};

template<> struct A<int>::B {};
A<int>::C<int> c;


This crashes during IR generation. The root cause is that the friend
declaration was marked invalid without any diagnostic being issued. It *is*
invalid (we aren't supposed to be looking up things within B, because it's a
dependent type, so it can't be given template arguments with <...>), but we
should actually produce an error saying so.

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