[LLVMbugs] [Bug 17588] New: Forward Declaration of classes Within Namespaces causes error

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Oct 15 02:51:36 PDT 2013


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

            Bug ID: 17588
           Summary: Forward Declaration of classes Within Namespaces
                    causes error
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: timac at timac.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11376
  --> http://llvm.org/bugs/attachment.cgi?id=11376&action=edit
Test code to reproduce the issue

The following code compiles with Clang bundled with Xcode 5.0 but produces an
error with Clang trunk:


#include <stdio.h>

namespace MyNamespace
{
    class MyClass
    {
    public:
        MyClass() { }
        ~MyClass() { }
    };
}

class MyNamespace::MyClass;

int main()
{
    fprintf(stderr, "Test code to reproduce an issue when compiling with Clang
trunk\n");
    return 0;
}


When compiling this file by performing the command
clang -o test test.cpp

you will see the error:

test.cpp:14:7: error: forward declaration of class cannot have a nested name
specifier
class MyNamespace::MyClass;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131015/6d996215/attachment.html>


More information about the llvm-bugs mailing list