<div dir="ltr">This should already be fixed; please try again with r241032.<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 29, 2015 at 6:49 PM, Filipe Cabecinhas <span dir="ltr"><<a href="mailto:filcab@gmail.com" target="_blank">filcab@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Richard,<div><br></div><div>It looks like this rev caused all our bots (Mac, Windows, and Linux. Clean Release+Asserts builds) to fail:<div><br></div><div><div>FAIL: Clang :: SemaCXX/override-in-system-header.cpp (6652 of 23274)</div><div>******************** TEST 'Clang :: SemaCXX/override-in-system-header.cpp' FAILED ********************</div><div>Script:</div><div>--</div><div>/home/buildbot/Buildbot/Slave/builds/1.LLVM.Linux.Phase.2/llvm.obj/./bin/clang -cc1 -internal-isystem /home/buildbot/Buildbot/Slave/builds/1.LLVM.Linux.Phase.2/llvm.obj/bin/../lib/clang/3.7.0/include -nostdsysteminc -std=c++11 -isystem /home/buildbot/Buildbot/Slave/builds/1.LLVM.Linux.Phase.2/clang.src/test/SemaCXX/Inputs /home/buildbot/Buildbot/Slave/builds/1.LLVM.Linux.Phase.2/clang.src/test/SemaCXX/override-in-system-header.cpp -verify</div><div>--</div><div>Exit Code: 1</div><div><br></div><div>Command Output (stderr):</div><div>--</div><div>error: 'error' diagnostics seen but not expected: </div><div> Line 10: initializer on function does not look like a pure-specifier</div><div> Line 17: initializer on function does not look like a pure-specifier</div><div>2 errors generated.</div><div><br></div><div>--</div><div><br></div><div>********************</div><div>Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. </div><div>Testing Time: 30.62s</div><div>********************</div><div>Failing Tests (1):</div><div> Clang :: SemaCXX/override-in-system-header.cpp</div><div><br></div><div><br></div><div>Could you take a look?</div><div><br></div><div>Thanks,</div><div class="gmail_extra"><br clear="all"><div><div> Filipe<br></div></div><div><div>
<br><div class="gmail_quote">On Mon, Jun 29, 2015 at 4:19 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard-llvm@metafoo.co.uk" target="_blank">richard-llvm@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: rsmith<br>
Date: Mon Jun 29 18:19:23 2015<br>
New Revision: 241019<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D241019-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=f3S1nfvnRr23amQkrfJbyn5aUmGgeV5oo4lq2aog9v8&s=DkyELZA5mo-hkAXFy7NO7gU3MWjY8S6JiKZ-RYrXWo8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=241019&view=rev</a><br>
Log:<br>
PR23942: a pure-specifier's integer literal must be spelled '0'<br>
<br>
Modified:<br>
cfe/trunk/lib/Sema/SemaDecl.cpp<br>
cfe/trunk/test/Parser/cxx-class.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Sema_SemaDecl.cpp-3Frev-3D241019-26r1-3D241018-26r2-3D241019-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=f3S1nfvnRr23amQkrfJbyn5aUmGgeV5oo4lq2aog9v8&s=yfvDl8Fpi9ISZdbks7Kq3-s5to7aReWCbR3oM9LXf4c&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=241019&r1=241018&r2=241019&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Jun 29 18:19:23 2015<br>
@@ -8783,6 +8783,19 @@ namespace {<br>
}<br>
}<br>
<br>
+/// Determine whether the given expression was formed from the token '0'. This<br>
+/// test is necessary to determine whether an initializer is really a<br>
+/// pure-specifier.<br>
+static bool isZeroToken(Sema &S, Expr *E) {<br>
+ auto *IL = dyn_cast<IntegerLiteral>(E);<br>
+ if (!IL || !!IL->getValue() ||<br>
+ !IL->getType()->isSpecificBuiltinType(BuiltinType::Int))<br>
+ return false;<br>
+<br>
+ SmallString<8> Buffer;<br>
+ return S.PP.getSpelling(E->getLocStart(), Buffer) == "0";<br>
+}<br>
+<br>
/// AddInitializerToDecl - Adds the initializer Init to the<br>
/// declaration dcl. If DirectInit is true, this is C++ direct<br>
/// initialization rather than copy initialization.<br>
@@ -8799,9 +8812,11 @@ void Sema::AddInitializerToDecl(Decl *Re<br>
// With declarators parsed the way they are, the parser cannot<br>
// distinguish between a normal initializer and a pure-specifier.<br>
// Thus this grotesque test.<br>
- IntegerLiteral *IL;<br>
- if ((IL = dyn_cast<IntegerLiteral>(Init)) && IL->getValue() == 0 &&<br>
- Context.getCanonicalType(IL->getType()) == Context.IntTy)<br>
+ //<br>
+ // FIXME: The parser should instead treat anything that looks like a<br>
+ // pure-specifier as a pure-specifier, and Sema should convert it to an<br>
+ // initializer when necessary, rather than doing things this way around.<br>
+ if (!DirectInit && isZeroToken(*this, Init))<br>
CheckPureMethod(Method, Init->getSourceRange());<br>
else {<br>
Diag(Method->getLocation(), diag::err_member_function_initialization)<br>
<br>
Modified: cfe/trunk/test/Parser/cxx-class.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_test_Parser_cxx-2Dclass.cpp-3Frev-3D241019-26r1-3D241018-26r2-3D241019-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=f3S1nfvnRr23amQkrfJbyn5aUmGgeV5oo4lq2aog9v8&s=EzKWiiLc_yW7vHPfW9sb3kI7TU7iW4EeZl7eL_BZ6kc&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-class.cpp?rev=241019&r1=241018&r2=241019&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Parser/cxx-class.cpp (original)<br>
+++ cfe/trunk/test/Parser/cxx-class.cpp Mon Jun 29 18:19:23 2015<br>
@@ -24,6 +24,16 @@ public:<br>
; // expected-warning{{extra ';' inside a class}}<br>
<br>
virtual int vf() const volatile = 0;<br>
+<br>
+ virtual int vf0() = 0l; // expected-error {{does not look like a pure-specifier}}<br>
+ virtual int vf1() = 1; // expected-error {{does not look like a pure-specifier}}<br>
+ virtual int vf2() = 00; // expected-error {{does not look like a pure-specifier}}<br>
+ virtual int vf3() = 0x0; // expected-error {{does not look like a pure-specifier}}<br>
+ virtual int vf4() = 0.0; // expected-error {{does not look like a pure-specifier}}<br>
+ virtual int vf5(){0}; // expected-error +{{}} expected-warning {{unused}}<br>
+ virtual int vf5a(){0;}; // function definition, expected-warning {{unused}}<br>
+ virtual int vf6()(0); // expected-error +{{}} expected-note +{{}}<br>
+ virtual int vf7() = { 0 }; // expected-error {{does not look like a pure-specifier}}<br>
<br>
private:<br>
int x,f(),y,g();<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" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div></div></div></div></div>
</blockquote></div><br></div></div>