[LLVMbugs] [Bug 7082] New: No warning/error for matching class and member variable/function names.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri May 7 00:02:00 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7082
Summary: No warning/error for matching class and member
variable/function names.
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: alex55miller+bug at gmail.com
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Created an attachment (id=4857)
--> (http://llvm.org/bugs/attachment.cgi?id=4857)
Test case.
Overview:
Both MSVC (http://msdn.microsoft.com/en-us/library/2bcktt82) and GCC do not
allow for a member variable/function of a class to have the same name as the
class. Clang (both 2.7 and compiled from SVN r101755) will compile the attached
test case with no warning or error and the program runs as expected.
I am not a standards guru, so I am not sure if this is in the standard or not.
Steps to Reproduce:
1) Run clang on test.cpp.
Actual Results:
No warnings/errors, and a fully working executable.
Expected Results:
A warning or error (like gcc's "test.cpp:9: error: field 'int C::C' with
same name as class")
Build Date & Platform:
>From r101755:
clang version 1.5 (trunk 101758)
Target: x86_64-unknown-linux-gnu
Thread model: posix
llvm version 2.8svn
DEBUG build with assertions.
Built Apr 18 2010 (20:04:13).
Host: x86_64-unknown-linux-gnu
Host CPU: penryn
and from 2.7:
clang version 1.1 (branches/release_27)
Target: x86_64-pc-linux-gnu
Thread model: posix
llvm version 2.8svn
DEBUG build with assertions.
Built Apr 18 2010 (20:04:13).
Host: x86_64-unknown-linux-gnu
Host CPU: penryn
--
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