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

            Bug ID: 118163
           Summary: [15 Regression] Diagnostic not fully silenced by
                    -Wno-template-body
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simartin at gcc dot gnu.org
  Target Milestone: ---

[ Found while investigating https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118078
]

Consider the following code:

===
template<class T>
struct S {
  S s;
};
==

By default we get both an error and an associated note about S being incomplete
at line 3:

===
diag.C:3:5: error: field ‘s’ has incomplete type ‘S<T>’ [-Wtemplate-body]
diag.C:2:8: note: definition of ‘struct S<T>’ is not complete until the closing
brace
===

However, when using -Wno-template-body, the error is suppressed as it should,
however the note remains, which makes the output puzzing to say the least.

===
diag.C:2:8: note: definition of ‘struct S<T>’ is not complete until the closing
brace
===

(see https://godbolt.org/z/W13qfz4v8)

Reply via email to