<div dir="ltr">Fixed in 192208. <div>Sorry.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/9 jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com" target="_blank">fjahanian@apple.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">These tests are failing on a windows buildbot.<div><br></div><div><pre style="font-family:'Courier New',courier,monotype,monospace">
<span>Failing Tests (3):
Clang :: CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp
Clang :: CXX/expr/expr.unary/expr.sizeof/p1.cpp
Clang :: Parser/expressions.c</span></pre><div><br></div><div>- Fariborz</div><div><div class="h5"><div><br></div><div><div>On Oct 8, 2013, at 9:56 AM, Serge Pavlov <<a href="mailto:sepavloff@gmail.com" target="_blank">sepavloff@gmail.com</a>> wrote:</div>
<br><blockquote type="cite">Author: sepavloff<br>Date: Tue Oct 8 11:56:30 2013<br>New Revision: 192200<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=192200&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=192200&view=rev</a><br>
Log:<br>Add fixits suggesting parenthesis around type name in expressions like sizeof.<br>This fixes PR16992 - Fixit missing when "sizeof type" found.<br><br>Modified:<br> cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td<br>
cfe/trunk/lib/Parse/ParseExpr.cpp<br> cfe/trunk/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp<br> cfe/trunk/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp<br> cfe/trunk/test/Parser/expressions.c<br><br>Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=192200&r1=192199&r2=192200&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=192200&r1=192199&r2=192200&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)<br>+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Oct 8 11:56:30 2013<br>
@@ -310,6 +310,8 @@ def err_unspecified_vla_size_with_static<br> def warn_deprecated_register : Warning<<br> "'register' storage class specifier is deprecated">,<br> InGroup<DeprecatedRegister>;<br>
+def err_missed_parenthesis_around_typename : Error<<br>+ "missed parenthesis around the type name in %0">;<br><br> def err_expected_case_before_expression: Error<<br> "expected 'case' keyword before expression">;<br>
<br>Modified: cfe/trunk/lib/Parse/ParseExpr.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=192200&r1=192199&r2=192200&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=192200&r1=192199&r2=192200&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)<br>+++ cfe/trunk/lib/Parse/ParseExpr.cpp Tue Oct 8 11:56:30 2013<br>@@ -1589,6 +1589,28 @@ Parser::ParseExprAfterUnaryExprOrTypeTra<br>
<br> // If the operand doesn't start with an '(', it must be an expression.<br> if (Tok.isNot(tok::l_paren)) {<br>+ // If construct allows a form without parenthesis, user may forget to put<br>+ // pathenthesis around type name.<br>
+ if (<a href="http://OpTok.is" target="_blank">OpTok.is</a>(tok::kw_sizeof) || <a href="http://OpTok.is" target="_blank">OpTok.is</a>(tok::kw___alignof) ||<br>+ <a href="http://OpTok.is" target="_blank">OpTok.is</a>(tok::kw_alignof) || <a href="http://OpTok.is" target="_blank">OpTok.is</a>(tok::kw__Alignof)) {<br>
+ bool isAmbiguousTypeId;<br>+ if (isTypeIdInParens(isAmbiguousTypeId)) {<br>+ DeclSpec DS(AttrFactory);<br>+ ParseSpecifierQualifierList(DS);<br>+ Declarator DeclaratorInfo(DS, Declarator::TypeNameContext);<br>
+ ParseDeclarator(DeclaratorInfo);<br>+<br>+ SourceLocation LParenLoc = PP.getLocForEndOfToken(OpTok.getLocation());<br>+ SourceLocation RParenLoc = PP.getLocForEndOfToken(PrevTokLocation);<br>+ Diag(LParenLoc, diag::err_missed_parenthesis_around_typename)<br>
+ << OpTok.getName()<br>+ << FixItHint::CreateInsertion(LParenLoc, "(")<br>+ << FixItHint::CreateInsertion(RParenLoc, ")");<br>+ isCastExpr = true;<br>
+ return ExprEmpty();<br>+ }<br>+ }<br>+<br> isCastExpr = false;<br> if (<a href="http://OpTok.is" target="_blank">OpTok.is</a>(tok::kw_typeof) && !getLangOpts().CPlusPlus) {<br> Diag(Tok,diag::err_expected_lparen_after_id) << OpTok.getIdentifierInfo();<br>
<br>Modified: cfe/trunk/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp?rev=192200&r1=192199&r2=192200&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp?rev=192200&r1=192199&r2=192200&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp (original)<br>+++ cfe/trunk/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp Tue Oct 8 11:56:30 2013<br>
@@ -14,3 +14,7 @@ template<typename T, typename A, int N><br><br> static_assert(alignof(Y<char, int, sizeof(int)>) == alignof(int), "");<br> static_assert(alignof(Y<int, char, 1>) == alignof(int), ""); // expected-note {{in instantiation of}}<br>
+<br>+void pr16992 () {<br>+ int x = alignof int; // expected-error{{missed parenthesis around the type name in alignof}}<br>+}<br><br>Modified: cfe/trunk/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp?rev=192200&r1=192199&r2=192200&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp?rev=192200&r1=192199&r2=192200&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp (original)<br>+++ cfe/trunk/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp Tue Oct 8 11:56:30 2013<br>
@@ -26,3 +26,23 @@ void test2() {<br> x = sizeof(test2()); // expected-error {{invalid application of 'sizeof' to an incomplete type 'void'}}<br> x = sizeof(test2); // expected-error {{invalid application of 'sizeof' to a function type}}<br>
}<br>+<br>+namespace pr16992 {<br>+<br>+template<typename T> struct ABC {<br>+ int func () {<br>+ return sizeof T; //expected-error{{missed parenthesis around the type name in sizeof}}<br>+ }<br>+};<br>+<br>+ABC<int> qq;<br>
+<br>+template<typename T> struct ABC2 {<br>+ int func () {<br>+ return sizeof T::A;<br>+ }<br>+};<br>+<br>+struct QQ { int A; };<br>+ABC2<QQ> qq2;<br>+}<br><br>Modified: cfe/trunk/test/Parser/expressions.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/expressions.c?rev=192200&r1=192199&r2=192200&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/expressions.c?rev=192200&r1=192199&r2=192200&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/test/Parser/expressions.c (original)<br>+++ cfe/trunk/test/Parser/expressions.c Tue Oct 8 11:56:30 2013<br>@@ -57,3 +57,13 @@ void test7() {<br>
({} // expected-note {{to match}}<br> ; // expected-error {{expected ')'}}<br> }<br>+<br>+// PR16992<br>+struct pr16992 { int x; };<br>+<br>+void func_16992 () {<br>+ int x1 = sizeof int; // expected-error{{missed parenthesis around the type name in sizeof}}<br>
+ int x2 = sizeof struct pr16992; // expected-error{{missed parenthesis around the type name in sizeof}}<br>+ int x3 = __alignof int; // expected-error{{missed parenthesis around the type name in __alignof}}<br>+ int x4 = _Alignof int; // expected-error{{missed parenthesis around the type name in _Alignof}}<br>
+}<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks,<br>--Serge<br>
</div>