LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 7970 - clang allows redeclaration of static data member
Summary: clang allows redeclaration of static data member
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: trunk
Hardware: All All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2010-08-23 02:07 PDT by Argyrios Kyrtzidis
Modified: 2010-08-30 09:34 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Argyrios Kyrtzidis 2010-08-23 02:07:27 PDT
struct S {
  static int val;
  static int val;
};

clang compiles the above sample without complaints.
It should say something like:

t2.cpp:3:9: error: duplicate member 'val'
  static int val;
             ^
t2.cpp:2:9: note: previous declaration is here
  static int val;
             ^
Comment 1 Faisal Vali 2010-08-25 01:59:37 PDT
This should be an easy fix - and I'm working on fixing this.  

Thanks for bringing it to my attention Argyrios via email.
Comment 2 Faisal Vali 2010-08-25 02:00:14 PDT
This should be an easy fix - and I'm working on it.  

Thanks for bringing it to my attention Argyrios via email.
Comment 3 Douglas Gregor 2010-08-30 09:34:10 PDT
Fixed in Clang r112476, by Faisal Vali!