[LLVMbugs] [Bug 5538] New: Lack of diagnostic when a static variable inside a class has the same name of the class type

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Nov 17 07:19:16 PST 2009


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

           Summary: Lack of diagnostic when a static variable inside a class
                    has the same name of the class type
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bolzoni at cs.unipr.it
                CC: llvmbugs at cs.uiuc.edu


clang does not diagnose when a static variable inside a class has the same name
of the class type.

example code:
-------------->
class A {
public:
  static int A;
};
--------------<

$ clang-cc example.cc ;echo $?
0

g++, instead, complains:
$ g++ example.cc ;echo $?
example.cc:3: error: ‘A::A’ has the same name as the class in which it is
declared
1

Here is the version:
$ clang-cc --version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.7svn
  DEBUG build with assertions.
  Built Nov 12 2009 (15:11:58). (downloaded via svn the same day)
  Host: x86_64-unknown-linux-gnu

Paolo Bolzoni


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