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

            Bug ID: 106072
           Summary: Bogus -Wnonnull warning breaks rust bootstrap
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---
            Target: sparc*-sun-solaris2.11

Created attachment 53198
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53198&action=edit
Workaround patch

Bootstrapping the devel/rust/master branch on Solaris/SPARC (both 32 and
64-bit)
breaks like this:

In file included from /vol/gcc/src/git/rust/gcc/rust/parse/rust-parse.h:727,
                 from
/vol/gcc/src/git/rust/gcc/rust/expand/rust-macro-builtins.cc:25:
/vol/gcc/src/git/rust/gcc/rust/parse/rust-parse-impl.h: In member function
'Rust::AST::ClosureParam
Rust::Parser<ManagedTokenSource>::parse_closure_param() [with
ManagedTokenSource = Rust::Lexer]':
/vol/gcc/src/git/rust/gcc/rust/parse/rust-parse-impl.h:9022:70: error: 'this'
pointer is null [-Werror=nonnull]
 9022 |                             std::move (type), std::move (outer_attrs));
      |                 

The error doesn't occur on i386-pc-solaris2.11, amd64-pc-solaris2.11,
i686-pc-linux-gnu, x86_64-pc-linux-gnu.

I've hacked around this with the attached patch.

The preprocessed file is 3.5 MB, unfortunately; currently trying to reduce it
to
something manageable, but this is slow going unfortunately.

Reply via email to