[LLVMbugs] [Bug 14156] New: clang accepts incorrect out of line class definition

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Oct 23 06:00:31 PDT 2012


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

             Bug #: 14156
           Summary: clang accepts incorrect out of line class definition
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: vanyacpp at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Clang accepts the following code. A interesting fact is that declaration of
x<T>::y::z actually define w<T>::z. The same declaration in MSVC declares class
in nowhere.

template <typename T>
struct w
{
    struct z;
};

template <typename T>
struct x
{
    typedef w<T> y;
};

template <typename T>
struct x<T>::y::z // REDEFINITION in clang, ERROR in gcc, comeau, OK in MSVC
(this declaration is ignored)
{};

I believe this code is incorrect and should be rejected.

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