public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug plugins/98059] New: [11 regression] Plugins don't compile with c++20
@ 2020-11-29 23:05 sss@li-snyder.org
  2020-11-30  8:13 ` [Bug plugins/98059] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: sss@li-snyder.org @ 2020-11-29 23:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98059
           Summary: [11 regression] Plugins don't compile with c++20
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: plugins
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sss@li-snyder.org
  Target Milestone: ---

The following example fails with gcc 11 (20201128):

$ echo '#include "gcc-plugin.h"' | g++  -x c++ -std=c++20 -c -o x.o - -I`g++
-print-file-name=plugin`/include
In file included from
/usr/local/gcc/lib/gcc/x86_64-pc-linux-gnu/11.0.0/plugin/include/config.h:8,
                 from
/usr/local/gcc/lib/gcc/x86_64-pc-linux-gnu/11.0.0/plugin/include/gcc-plugin.h:27,
                 from <stdin>:1:
/usr/local/gcc/lib/gcc/x86_64-pc-linux-gnu/11.0.0/plugin/include/ansidecl.h:424:9:
error: expected unqualified-id before ‘const’
  424 |   TYPE (const TYPE&) = delete;                  \
      |         ^~~~~
/usr/local/gcc/lib/gcc/x86_64-pc-linux-gnu/11.0.0/plugin/include/vec.h:1605:3:
note: in expansion of macro ‘DISABLE_COPY_AND_ASSIGN’
 1605 |   DISABLE_COPY_AND_ASSIGN(auto_delete_vec<T>);
      |   ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/gcc/lib/gcc/x86_64-pc-linux-gnu/11.0.0/plugin/include/ansidecl.h:424:9:
error: expected ‘)’ before ‘const’
  424 |   TYPE (const TYPE&) = delete;                  \
      |        ~^~~~~
/usr/local/gcc/lib/gcc/x86_64-pc-linux-gnu/11.0.0/plugin/include/vec.h:1605:3:
note: in expansion of macro ‘DISABLE_COPY_AND_ASSIGN’
 1605 |   DISABLE_COPY_AND_ASSIGN(auto_delete_vec<T>);
      |   ^~~~~~~~~~~~~~~~~~~~~~~


Can be fixed with this patch:

diff --git a/gcc/vec.h b/gcc/vec.h
index 14d77e87342..90904515ea0 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1602,7 +1602,7 @@ class auto_delete_vec : public auto_vec <T *>
   ~auto_delete_vec ();

 private:
-  DISABLE_COPY_AND_ASSIGN(auto_delete_vec<T>);
+  DISABLE_COPY_AND_ASSIGN(auto_delete_vec);
 };

 /* Conditionally allocate heap memory for VEC and its internal vector.  */

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

end of thread, other threads:[~2021-01-06  9:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-29 23:05 [Bug plugins/98059] New: [11 regression] Plugins don't compile with c++20 sss@li-snyder.org
2020-11-30  8:13 ` [Bug plugins/98059] " rguenth at gcc dot gnu.org
2020-12-02 13:55 ` jakub at gcc dot gnu.org
2020-12-02 14:44 ` cvs-commit at gcc dot gnu.org
2020-12-02 16:20 ` redi at gcc dot gnu.org
2020-12-02 16:22 ` redi at gcc dot gnu.org
2020-12-02 16:27 ` jakub at gcc dot gnu.org
2020-12-02 16:29 ` redi at gcc dot gnu.org
2020-12-02 16:31 ` jakub at gcc dot gnu.org
2021-01-06  9:39 ` cvs-commit 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).