<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 6:46 AM, Suyog Kamal Sarda <span dir="ltr"><<a href="mailto:suyog.sarda@samsung.com" target="_blank" class="cremed">suyog.sarda@samsung.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Daniel for the clarification.<br>
<br>
Any opinion on change in error string to include mention about c++11 standard?<br></blockquote><div><br></div><div>Not really, I am mostly working on clang-format. Similarly, I don't know what the tradeoffs for making -std=c++11 the default at some point.</div><div><br></div><div>Cheers,<br>Daniel</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards,<br>
Suyog<br>
<br>
------- Original Message -------<br>
Sender : Daniel Jasper<<a href="mailto:djasper@google.com" class="cremed">djasper@google.com</a>><br>
Date : Oct 29, 2014 22:38 (GMT+09:00)<br>
Title : Re: [Clang-format] space between closing angles for templates<br>
<div class="HOEnZb"><div class="h5"><br>
This is controlled by the style flag "Standard" (<a href="http://clang.llvm.org/docs/ClangFormatStyleOptions.html" target="_blank" class="cremed">http://clang.llvm.org/docs/ClangFormatStyleOptions.html</a>), which is set to Cpp11 for LLVM style. This is intended as LLVM/Clang code is compiled for C++11 and we want to format it accordingly. If you need a different compatibility mode, you can set the flag to a different value as described on the mentioned page. Certainly, there is no need to change the implementation ;-).<br>
<br>
<br>
<br>
<br>
On Wed, Oct 29, 2014 at 4:39 AM, Suyog Kamal Sarda <<a href="mailto:suyog.sarda@samsung.com" class="cremed">suyog.sarda@samsung.com</a>> wrote:<br>
<br>
Hi Daniel,<br>
<br>
Had few questions related to space between closing angles for templates.<br>
<br>
Test code : vector<vector<int> > matrix(RR); (there is a space between the two closing angles).<br>
<br>
When I run clang-format on this, it uses LLVM style by default and eliminates space between the two angles.<br>
After formatting : vector<vector<int>> matrix(RR);<br>
<br>
When I try to compile the code, I get the error<br>
"a space is required between consecutive right angle brackets".<br>
<br>
When I compile the formatted code with -std=c++11 option, it compiles without error.<br>
The new standard accepts closing angles without spaces while older needs space between the two.<br>
<br>
With other styles - Google, Chromium, Mozilla, Webkit - clang-format doesn't remove the space between<br>
the angles. Google and Chromium style accepts both the format, Webkit and Mozilla inserts space if not present.<br>
<br>
Does LLVM style by default follow c++11 standard?<br>
( I saw both '> >' and '>>' in LLVM code. )<br>
<br>
Should the default style (which is LLVM) remove the space or should it accept both cases?<br>
<br>
Shouldn't the error string "a space is required between consecutive right angle brackets" also<br>
include mention about c++11 standard? Something like 'allowed in c++11 onwards' to make things<br>
more clear?<br>
<br>
Because running clang-format with default style on code with space separate angles<br>
and then compiling without -std=c++11 option throws error which is somewhat confusing.<br>
<br>
I tried changing the code the in TokenAnnotator.cpp file in function 'calculateFormattingInformation'<br>
where I keep track of number of TemplateCloser, and if the number > 1 then set the SpaceRequiredBefore<br>
to 1. However this was breaking several test cases, mostly related to specific styles.<br>
<br>
Regards,<br>
Suyog</div></div></blockquote></div><br></div></div>