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

            Bug ID: 19427
           Summary: clang does not diagnose declaration of name inside
                    class scope
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Testcase:

namespace ns {
 class Module { };
}

namespace ns {
class Module;

class Foo {
 Module *Module;
};
}

Clang issues no error. GCC says:

a.cc:9:11: error: declaration of ‘ns::Module* ns::Foo::Module’ [-fpermissive]
  Module *Module;
          ^
a.cc:2:9: error: changes meaning of ‘Module’ from ‘class ns::Module’
[-fpermissive]
  class Module { };
        ^

GCC is correct. This is invalid per [basic.scope.class]/1 bullet 2. This is
NDR, but gcc diagnoses it, and it shouldn't be inefficient for us to do the
same (we need to do a name lookup on newly declared names anyways).

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