[LLVMbugs] [Bug 6885] New: Diagnostic for friend declaration inside of a namespace with same name

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 20 19:51:55 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=6885

           Summary: Diagnostic for friend declaration inside of a
                    namespace with same name
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jason.haslam at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


I don't know if this is valid but gcc accepts it:

hack:~ jason$ cat test.cpp 
namespace A {
    class B {
        friend class A;
    };
}

hack:~ jason$ clang++ test.cpp 
test.cpp:3:16: error: redefinition of 'A' as different kind of symbol
                friend class A;
                             ^
test.cpp:1:11: note: previous definition is here
namespace A {
          ^
1 error generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list