From: Jason Merrill <jason@redhat.com>
To: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH to primary_template_instantiation_p
Date: Tue, 28 Nov 2017 18:28:00 -0000 [thread overview]
Message-ID: <CADzB+2kBnXGhLPb1r1A1yoHS3bhDy5jWZ37LCOAkBDXQQscU-A@mail.gmail.com> (raw)
In-Reply-To: <FB2BF9A5-60EA-4789-A1DE-F78CB8D1D8DC@linaro.org>
Fixed, thanks.
On Tue, Nov 28, 2017 at 10:49 AM, Maxim Kuvyrkov
<maxim.kuvyrkov@linaro.org> wrote:
>
>> On Nov 28, 2017, at 12:29 AM, Jason Merrill <jason@redhat.com> wrote:
>>
>> All the uses of primary_template_instantiation_p actually want to
>> query whether the entity in question is a specialization of the
>> template, not whether it's an instantiation or explicit
>> specialization.
>>
>> Tested x86_64-pc-linux-gnu, applying to trunk.
>> <primary-tmpl.diff>
>
> Hi Jason,
>
> I get the following failure with the new test on x86_64-linux-gnu and aarch64-linux-gnu:
>
>> --- /dev/null
>> +++ b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2a.C
>> @@ -0,0 +1,27 @@
>> +// PR c++/46831
>> +// { dg-do compile { target c++11 } }
>> +// { dg-options "" }
>> +
>> +struct B { };
>> +struct D : B { };
>> +struct A {
>> + template<typename T = void> operator D&(); // { dg-message "template conversion" }
>> + operator long();
>> +};
>> +
>> +template <> A::operator D&();
>
> "Template conversion" warning is triggered on this line, rather than above.
>
>> +
>> +void f(long);
>> +void f(B&);
>> +
>> +struct A2 {
>> + template<typename T = void> operator B&();
>> +};
>> +
>> +void f2(const B&);
>> +
>> +int main() {
>> + f(A());
>> + f2(A2());
>> + f2(A()); // { dg-error "" }
>> +}
>>
>
> Would you please take a look?
>
> ===
> spawn -ignore SIGHUP /home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/_build/builds/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/gcc.git~master-stage2/gcc/testsuite/g++5/../../xg++ -B/home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/_build/builds/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/gcc.git~master-stage2/gcc/testsuite/g++5/../../ /home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2a.C -fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++ -I/home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/_build/builds/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/gcc.git~master-stage2/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/_build/builds/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/gcc.git~master-stage2/x86_64-unknown-linux-gnu/libstdc++-v3/include -I/home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/libstdc++-v3/libsupc++ -I/home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/libstdc++-v3/include/backward -I/home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/libstdc++-v3/testsuite/util -fmessage-length=0 -std=gnu++11 -S -o fntmpdefarg2a.s
> /home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2a.C: In function 'int main()':
> /home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2a.C:26:6: error: invalid user-defined conversion from 'A' to 'const B&' [-fpermissive]
> /home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2a.C:12:13: note: candidate is: 'A::operator D&() [with T = void]' <near match>
> /home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2a.C:12:13: note: conversion from return type 'D&' of template conversion function specialization to 'const B&' is not an exact match
> /home/tcwg-buildslave/workspace/tcwg-buildfarm/tcwg-x86_64-build/snapshots/gcc.git~master/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2a.C:21:6: note: initializing argument 1 of 'void f2(const B&)'
> compiler exited with status 1
> FAIL: g++.dg/cpp0x/fntmpdefarg2a.C -std=gnu++11 (test for warnings, line 8)
> PASS: g++.dg/cpp0x/fntmpdefarg2a.C -std=gnu++11 (test for errors, line 26)
> PASS: g++.dg/cpp0x/fntmpdefarg2a.C -std=gnu++11 (test for excess errors)
> ===
>
> Regards,
>
> --
> Maxim Kuvyrkov
> www.linaro.org
>
>
>
prev parent reply other threads:[~2017-11-28 18:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 21:37 Jason Merrill
2017-11-28 16:00 ` Maxim Kuvyrkov
2017-11-28 18:28 ` Jason Merrill [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADzB+2kBnXGhLPb1r1A1yoHS3bhDy5jWZ37LCOAkBDXQQscU-A@mail.gmail.com \
--to=jason@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=maxim.kuvyrkov@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).