This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86301] g++ does not mark declarations used in non-dependent types as referenced
- From: "zhonghao at pku dot org.cn" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Jun 2018 11:07:30 +0000
- Subject: [Bug c++/86301] g++ does not mark declarations used in non-dependent types as referenced
- Auto-submitted: auto-generated
- References: <bug-86301-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86301
--- Comment #5 from zhonghao at pku dot org.cn ---
(In reply to Jonathan Wakely from comment #4)
> If you tried the latest g++ why are you reporting bugs for version 8.0.1?
(In reply to Jonathan Wakely from comment #3)
> (In reply to zhonghao from comment #2)
> > (In reply to Jonathan Wakely from comment #1)
> > > (In reply to zhonghao from comment #0)
> > > > A previous version of clang++ produces similar error message for this code,
> > > > but was fixed.
> > >
> > > No it didn't, the error shown in the Clang bug comes from GCC!
> > >
> > > Please make more effort to understand what you are doing, OR I WILL BAN YOUR
> > > ACCOUNT.
> >
> > Did you try the latest g++ and clang++.
>
> Yes.
>
> > They produce different results when
> > they compile the code. My clang is 7.0.0. It does not produce any error
> > messages for this code.
>
> That doesn't mean the code is valid.
Is the code invalid? Do you mean that clang accepts a piece of invalid code?
That sounds a bug in clang?
>
> > Do the difference indicate bugs in g++?
>
> No. See https://gcc.gnu.org/gcc-7/porting_to.html#hypothetical-instantiation
Is this code a corner case? Or, does it illustrate an undefined behavior?