<p dir="ltr">Great! Thanks for the test cases. I am going to implement the rest and keep you guys updated. Btw, where is your repository so I can contribute directly into your repository instead of doing this here in the mailing list.</p>
<div class="gmail_quot<blockquote class=" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
[Please reply *only* to the list and do not include my email directly<br>
in the To: or Cc: of your reply; otherwise I will not see your reply.<br>
Thanks.]<br>
<br>
In article <CAC8rT1_WHgg4wE0Tn2s-GqWSZ_tA5UJYF=<a href="mailto:sSpBh0c%2BQoGu93zw@mail.gmail.com">sSpBh0c+QoGu93zw@mail.gmail.com</a>>,<br>
Firat Kasmis via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> writes:<br>
<br>
> I just improved and simplified the code. Now auto, decltype<br>
> and initializer_list work too. As you can see in the example, auto is<br>
> automatically transformed into its deduced type (there is a way to keep the<br>
> auto keyword) and long int will get long. An additional if-statement would<br>
> change both behavior if you like.<br>
><br>
> Now, you only need the DeclarationTransformer: <a href="http://pastebin.com/Luu1i9s3" rel="noreferrer" target="_blank">http://pastebin.com/Luu1i9s3</a><br>
> Example before and after: <a href="http://pastebin.com/KnrzNWnM" rel="noreferrer" target="_blank">http://pastebin.com/KnrzNWnM</a> -><br>
> <a href="http://pastebin.com/rLmPZRxP" rel="noreferrer" target="_blank">http://pastebin.com/rLmPZRxP</a><br>
><br>
> There is always a simple solution! :-)<br>
<br>
Awesome!<br>
<br>
A couple other things to try:<br>
<br>
- C++11 brace initialization<br>
<br>
std::vector<std::string> s{"foo"s, "bar"s}, t{"foo"s}, u;<br>
=><br>
std::vector<std::string> s{"foo"s, "bar"s};<br>
std::vector<std::string> t{"foo"s};<br>
std::vector<std::string> u;<br>
<br>
- function declarations<br>
<br>
void f(int), g(int, float);<br>
=><br>
void f(int);<br>
void g(int, float);<br>
<br>
- pointers to functions<br>
<br>
void gg(int, float);<br>
void (*f)(int), (*g)(int, float) = gg;<br>
=><br>
void gg(int, float);<br>
void (*f)(int);<br>
void (*g)(int, float) = gg;<br>
<br>
- pointers to member data<br>
<br>
struct S { int a; const int b; };<br>
int S::*p = &S::a, S::* const q = &S::a;<br>
const int S::*r = &S::b, S::*t;<br>
=><br>
struct S { int a; const int b; };<br>
int S::*p = &S::a;<br>
int S::* const q = &S::a;<br>
const int S::*r = &S::b;<br>
const int S::*t;<br>
<br>
- pointers to member functions<br>
<br>
struct S { int f(); };<br>
int (S::*p)() = &S::f, (S::*q)();<br>
=><br>
struct S { int f(); };<br>
int (S::*p)() = &S::f;<br>
int (S::*q)();<br>
<br>
I haven't looked at your implementation to specifically see if any of<br>
these are a problem, but in my experience these more "exotic" types<br>
are often a weak spot in refactoring tools. clang tooling<br>
infrastructure tends to do a little better here because it's a real<br>
parser.<br>
--<br>
"The Direct3D Graphics Pipeline" free book <<a href="http://tinyurl.com/d3d-pipeline" rel="noreferrer" target="_blank">http://tinyurl.com/d3d-pipeline</a>><br>
The Computer Graphics Museum <<a href="http://ComputerGraphicsMuseum.org" rel="noreferrer" target="_blank">http://ComputerGraphicsMuseum.org</a>><br>
The Terminals Wiki <<a href="http://terminals.classiccmp.org" rel="noreferrer" target="_blank">http://terminals.classiccmp.org</a>><br>
Legalize Adulthood! (my blog) <<a href="http://LegalizeAdulthood.wordpress.com" rel="noreferrer" target="_blank">http://LegalizeAdulthood.wordpress.com</a>><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div>