<div dir="ltr"><div class="gmail_extra">Thanks, this looks good. Please also add test cases (with FIXMEs) for the two cases mentioned in your FIXME comment, then this looks fine to commit.<br><br><div class="gmail_quote">On Mon, Apr 21, 2014 at 8:24 AM, Dinesh Dwivedi <span dir="ltr"><<a href="mailto:dinesh.d@samsung.com" target="_blank">dinesh.d@samsung.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Hi Richard,<br>
<br>
Thanks for reviewing.<br>
<br>
I have updated patch to handle this issue in typo-correction. This can be further improved is we can check if suggested typo belong to base class or not.<br>
<br>
I have merged test case in using-decl-1.cpp as suggested.<br>
<br>
Please have a look.<br>
<br>
Hi rjmccall, rsmith,<br>
<br>
<a href="http://reviews.llvm.org/D3051" target="_blank">http://reviews.llvm.org/D3051</a><br>
<br>
CHANGE SINCE LAST DIFF<br>
<a href="http://reviews.llvm.org/D3051?vs=7764&id=8699#toc" target="_blank">http://reviews.llvm.org/D3051?vs=7764&id=8699#toc</a><br>
<br>
Files:<br>
lib/Sema/SemaDeclCXX.cpp<br>
test/SemaCXX/using-decl-1.cpp<br>
<div class=""><br>
Index: lib/Sema/SemaDeclCXX.cpp<br>
===================================================================<br>
--- lib/Sema/SemaDeclCXX.cpp<br>
+++ lib/Sema/SemaDeclCXX.cpp<br>
</div>@@ -7326,6 +7326,12 @@<br>
if (!ND || isa<NamespaceDecl>(ND))<br>
return false;<br>
<br>
+ // FIXME: We should check if ND is member of base class of class having<br>
+ // using declaration and direct base class in case using declaration names<br>
+ // a constructor.<br>
+ if (RequireMember && !ND->isCXXClassMember())<br>
+ return false;<br>
+<br>
if (RequireMember && !isa<FieldDecl>(ND) && !isa<CXXMethodDecl>(ND) &&<br>
!isa<TypeDecl>(ND))<br>
return false;<br>
Index: test/SemaCXX/using-decl-1.cpp<br>
===================================================================<br>
--- test/SemaCXX/using-decl-1.cpp<br>
+++ test/SemaCXX/using-decl-1.cpp<br>
@@ -194,3 +194,15 @@<br>
using A::HiddenLocalExtern2;<br>
<div class=""> }<br>
}<br>
+<br>
+struct Z {<br>
+ Z();<br>
+};<br>
+<br>
+typedef struct {<br>
</div>+ Z i;<br>
+} S;<br>
<div class="HOEnZb"><div class="h5">+<br>
+struct Y : S {<br>
+ using S::S; // expected-error {{no member named 'S' in 'S'}}<br>
+};<br>
</div></div></blockquote></div><br></div></div>