[cfe-dev] Don't help the compiler!

Csaba Raduly rcsaba at gmail.com
Fri Jan 23 08:32:00 PST 2015


Hi all,
STL (Stephan T. Lavavej) in his talk at Going Native 2013, gave this
example of an attempt to "help the compiler", which is at best
superfluous:

    auto p = std::make_pair<int, double>(42, 3.1415);

and recommended

    auto p = std::make_pair             (42, 3.1415);

I thought of writing a plugin to warn in the "helpful" case. However,
clang -std=c++11 -Xclang -ast-dump produced virtually identical output.

Is there a way to distinguish between these two situations?

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pair_expl.ast
Type: application/octet-stream
Size: 2798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150123/b70d4b3b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pair_impl.ast
Type: application/octet-stream
Size: 2798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150123/b70d4b3b/attachment-0001.obj>


More information about the cfe-dev mailing list