public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102036] New: -Wmismatched-tags doesn't warn for explicit instantations
@ 2021-08-24 11:30 redi at gcc dot gnu.org
  2021-08-24 13:43 ` [Bug c++/102036] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-24 11:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102036

            Bug ID: 102036
           Summary: -Wmismatched-tags doesn't warn for explicit
                    instantations
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---

Clang gives a -Wmismatched-tags warning about this, but GCC doesn't:

template<typename T> struct X { };
template class X<int>;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/102036] -Wmismatched-tags doesn't warn for explicit instantations
  2021-08-24 11:30 [Bug c++/102036] New: -Wmismatched-tags doesn't warn for explicit instantations redi at gcc dot gnu.org
@ 2021-08-24 13:43 ` cvs-commit at gcc dot gnu.org
  2021-08-24 14:40 ` msebor at gcc dot gnu.org
  2021-12-14 22:16 ` msebor at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-24 13:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102036

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:d8b7282ea27e02f687272cb8ea5f66ca900f1582

commit r12-3118-gd8b7282ea27e02f687272cb8ea5f66ca900f1582
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Aug 24 12:31:06 2021 +0100

    libstdc++: Fix mismatched class-key tags

    Clang warns about this, but GCC doesn't (see PR c++/102036).

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            * src/c++11/cxx11-shim_facets.cc: Fix mismatched class-key in
            explicit instantiation definitions.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/102036] -Wmismatched-tags doesn't warn for explicit instantations
  2021-08-24 11:30 [Bug c++/102036] New: -Wmismatched-tags doesn't warn for explicit instantations redi at gcc dot gnu.org
  2021-08-24 13:43 ` [Bug c++/102036] " cvs-commit at gcc dot gnu.org
@ 2021-08-24 14:40 ` msebor at gcc dot gnu.org
  2021-12-14 22:16 ` msebor at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-08-24 14:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102036

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-08-24
           Severity|enhancement                 |normal
     Ever confirmed|0                           |1

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  The warning should trigger in this case so it's a bug rather than
an enhancement.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/102036] -Wmismatched-tags doesn't warn for explicit instantations
  2021-08-24 11:30 [Bug c++/102036] New: -Wmismatched-tags doesn't warn for explicit instantations redi at gcc dot gnu.org
  2021-08-24 13:43 ` [Bug c++/102036] " cvs-commit at gcc dot gnu.org
  2021-08-24 14:40 ` msebor at gcc dot gnu.org
@ 2021-12-14 22:16 ` msebor at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-12-14 22:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102036

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=103703

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
G++ also doesn't warn for more involved cases like the one in pr103703 (with
the ICE fixed):

template <typename T>
struct A
{
  struct B { };
};

template <typename T>
struct C
{
  friend class A<C>::B;       // { dg-warning "-Wmismatched-tags" "pr102036" {
xfail *-*-* } }
};

template struct C<int>;

Clang warns for the above but also suffers from a false positive below:

template <typename T>
struct D
{
  friend class A<D>::B;       // okay, specialized as class below
};

template <>
struct A<long>
{
  class B { };
};

template struct D<long>;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-14 22:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24 11:30 [Bug c++/102036] New: -Wmismatched-tags doesn't warn for explicit instantations redi at gcc dot gnu.org
2021-08-24 13:43 ` [Bug c++/102036] " cvs-commit at gcc dot gnu.org
2021-08-24 14:40 ` msebor at gcc dot gnu.org
2021-12-14 22:16 ` msebor at gcc dot gnu.org

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).