<div>Hi,</div>
<div> </div>
<div>I've been experimenting with an implementation for using declarations that I'd like to bounce off you, to make sure I'm going down the right path.  I've enclosed a patch of the current changes, in case you want to use them now.  These are a high-level description of the key changes/additions so far:</div>

<div> </div>
<div>1. Create a new decl class, UsingAliasDecl, derived form NamedDecl, mainly storing a pointer to the target decl.</div>
<div> </div>
<div>2. Add parsing code to Parser::ParseUsingDeclaration.  (Note: the 'typename' keyword is parsed, but the semantic actions elsewhere don't support type using decls.  No attempt to parse the 'concept' stuff yet)</div>

<div> </div>
<div>3. Handle parsing using declarations in classes (Parser::ParseCXXClassMemberDeclaration).</div>
<div> </div>
<div>4. Define and implement Action::ActOnUsingDeclaration (both MinimalAction.cpp and SemaDeclCXX.cpp).</div>
<div> </div>
<div>5. Where the declared using identifier is used in expressions (i.e. Sema::ActOnDeclarationNameExpr), substitute the target decl, i.e.:</div>
<div> </div>
<div>  if (UsingAliasDecl *UsingAlias = dyn_cast<UsingAliasDecl>(D))<br>    D = UsingAlias->getTargetDecl();<br></div>
<div>6. For the case of global or member functions with the same name as the using declaration, in the semantic action functions dealing with same-named functions, don't match a using declaration.  I'm hoping it doesn't matter if the using decl hides a previous declaration of the same name.</div>

<div> </div>
<div>Question:  Is the UsingAliasDecl class the right way to go, and is the name okay?</div>
<div> </div>
<div>Question:  When encountering a name corresponding to a using declaration in an expression, is just substituting the target declaration okay? I'm worried that losing the semantic information about an identifier in a statement or expression corresponding to a using declaration might be an issue.  But just substituting the target decl makes for simpler code so far.</div>

<div> </div>
<div>
<div>I'm writing a cxx-using-declaration.cpp test file, which will later have examples from the C++ standard draft or comparible ones.  I've enclosed the simple non-error case version I've used so far.  While I'm waiting for feedback, I'll work on adding more test cases, and getting the 'using typename' to work.</div>
</div>
<div><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br></div>