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

           Summary: incorrect parsing of friend declaration with a ::
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


gcc accepts but clang rejects:

-----------------------------------
struct C {
  enum bar { foo };
};
C::bar zed();
class D {
  friend C::bar ::zed();
};
-----------------------------------

the error message

test.ii:6:13: error: expected a class or namespace
  friend C::bar ::zed();
         ~~~^
test.ii:6:19: error: C++ requires a type specifier for all declarations
  friend C::bar ::zed();
  ~~~~~~          ^

suggest that clang is trying to parse the return type of zed as the class we
are declaring friendship with.

Removing the :: before zed makes clang accept the code.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to