[LLVMbugs] [Bug 6818] New: clang++ permits use of private struct.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 11 09:55:35 PDT 2010


           Summary: clang++ permits use of private struct.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: markus at unixforces.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

clang++ accepts the following code, while g++ does not:

class List {
        struct Elem {
            Elem* n;
int main()
    List::Elem a;

I'm not entirely sure which one is correct, but I think this should not be
accepted by clang++.

$ clang++ -v
clang version 1.5 (trunk 99761)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ g++ -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with:
--prefix=/usr --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu
--mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
--sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking
--disable-silent-rules --enable-fast-install --libdir=/usr/lib64
--disable-multilib --enable-languages=c++,ada,fortran,java
--enable-libstdcxx-pch=yes --enable-nls --program-suffix=-4.4
--with-pkgversion='Exherbo gcc-4.4.3' --without-cloog --without-ppl
--with-system-zlib --disable-libssp
Thread model: posix
gcc version 4.4.3 (Exherbo gcc-4.4.3)

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