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

           Summary: "friend class" implies forward declaration "class"?
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


The following example will compile in g++ but not in clang++:

#include <stdio.h>

/* If you uncomment the forward declaration, then this compiles OK
   (but g++ does not require the forward declaration):
*/
// class FooImpl;

class Foo_connection {
    private:
        friend class FooImpl;
        Foo_connection(FooImpl&);
};


int main() {
  int i = 1;
  printf("%d \n",++i);
}

-----
clang++     testcase.cc   -o testcase
testcase.cc:9:31: error: expected ')'
        Foo_connection(FooImpl&);
                              ^

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