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

            Bug ID: 38202
           Summary: inaccessible types allowed as template argument in
                    nested-name-specifier
           Product: clang
           Version: unspecified
          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

The code is as follow:

template<class T>
struct list
{
 struct nested { };
};


class F
{
 struct R { };
 class Q
 {
 friend void f(const Q &q) { list<R>::nested n; }
 };
};

clang++ accepts it, but g++ rejects it:

error: 'struct F::R' is private within this context
  friend void f(const Q &q) { list<R>::nested n; }
                                   ^
code1.c.cpp:10:9: note: declared private here
  struct R { };
         ^

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