public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alex Hornby <ahornby@fb.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: New g++ folly compile error with gcc 11.x. Bisected to PR99445 c++: Alias template in pack expansion
Date: Thu, 13 Jan 2022 11:45:00 +0000	[thread overview]
Message-ID: <MW4PR15MB4444CB74DC3106008972CDD5D0529@MW4PR15MB4444.namprd15.prod.outlook.com> (raw)

When compiling folly on Fedora 35 with gcc from the included 11.2.1-7 package, I found that the badge_test code fails to compile,  whereas it builds fine with gcc 10.x and with the fedora 35 clang (13.0.0-3.fc35)).

Bisecting from https://gcc.gnu.org/git/gcc.git  with pre-processed source indicates problem introduced in commit: [a2531859bf5bf6cf1f29c0dca85fd26e80904a5d] c++: Alias template in pack expansion [PR99445]

Bisected with commands, (bisection script below)
git bisect start basepoints/gcc-12 basepoints/gcc-11
git bisect run ~/local/bisect/gxx_bisect.sh

Example  of the problem from a folly build along with the command line I got preprocessed source from is in  https://github.com/facebook/folly/commit/af966d2ce25c14c96373bf39c8ae2b406219ffb4

Error looks like:

'/home/alex/local/bisect/test/0cc79337ad265aabccab63882a810f9dc509a9d0/build'
In file included from /home/alex/local/folly/folly/lang/test/BadgeTest.cpp:19:
/home/alex/local/folly/folly/lang/Badge.h: In instantiation of ‘class folly::any_badge<{anonymous}::FriendClass, {anonymous}::OtherFriendClass>’:
/home/alex/local/folly/folly/lang/test/BadgeTest.cpp:38:40:   required from here
/home/alex/local/folly/folly/lang/Badge.h:99:18: error: expansion pattern ‘folly::StrictDisjunction<std::is_same<OtherHolders, Holders>...>’ contains no parameter packs
   99 |   /* implicit */ any_badge(any_badge<OtherHolders...>) noexcept {}
      |                  ^~~~~~~~~
/home/alex/local/folly/folly/lang/Badge.h: In instantiation of ‘class folly::any_badge<{anonymous}::FriendClass, {anonymous}::OtherFriendClass, {anonymous}::DummyClass>’:
/home/alex/local/folly/folly/lang/test/BadgeTest.cpp:39:53:   required from here
/home/alex/local/folly/folly/lang/Badge.h:99:18: error: expansion pattern ‘folly::StrictDisjunction<std::is_same<OtherHolders, Holders>...>’ contains no parameter packs
/home/alex/local/folly/folly/lang/test/BadgeTest.cpp: In static member function ‘static void {anonymous}::ProtectedClass::subset({anonymous}::SubsetBadges)’:
/home/alex/local/folly/folly/lang/test/BadgeTest.cpp:39:54: error: cannot convert ‘any_badge<{anonymous}::FriendClass, {anonymous}::OtherFriendClass>’ to ‘any_badge<{anonymous}::FriendClass, {anonymous}::OtherFriendClass, {anonymous}::DummyClass>’
   39 |   static void subset(SubsetBadges badges) { superset(badges); }
      |                                                      ^~~~~~
      |                                                      |
      |                                                      any_badge<{anonymous}::FriendClass, {anonymous}::OtherFriendClass>
/home/alex/local/folly/folly/lang/test/BadgeTest.cpp:40:24: note:   initializing argument 1 of ‘static void {anonymous}::ProtectedClass::superset({anonymous}::SupersetBadges)’
   40 |   static void superset(SupersetBadges) {}
      |                        ^~~~~~~~~~~~~~
In file included from /home/alex/local/folly/folly/lang/test/BadgeTest.cpp:19:
/home/alex/local/folly/folly/lang/Badge.h: In instantiation of ‘class folly::any_badge<{anonymous}::FriendClass>’:
/home/alex/local/folly/folly/lang/test/BadgeTest.cpp:47:35:   required from here
/home/alex/local/folly/folly/lang/Badge.h:99:18: error: expansion pattern ‘folly::StrictDisjunction<std::is_same<OtherHolders, Holders>...>’ contains no parameter packs
   99 |   /* implicit */ any_badge(any_badge<OtherHolders...>) noexcept {}
      |                  ^~~~~~~~~
Exited with 0


Bisection script was:

#!/bin/sh
# adapted from http://moxielogic.org/blog/bisecting-gcc.html
# Test with:
#   cd local/gcc #(or whereever gcc git repo is) 
#   ./bisect/gxx_bisect.sh
# Run with:
#   git bisect run ~/local/bisect/gxx_bisect.sh

# git clone of the gcc tree
GCCSRC="$HOME/local/gcc"

# pre-processed test case
TESTSRC="$HOME/local/bisect/bisect_source.i"

COMMIT=`git rev-parse HEAD`

# Where to put gcc build and install dirs
testdir="$HOME/local/bisect/test/$COMMIT"

mkdir -p "$testdir/build"
mkdir -p "$testdir/install"

# configure for C & C++
(cd "$testdir/build" &&
 $GCCSRC/configure --prefix="$testdir/install" --enable-languages=c,c++ --with-system-zlib --disable-multilib --disable-libsanitizer --disable-bootstrap &&
 make -j 32 && make -j 32 install)

cxxbin="$testdir/install/bin/g++"

if test -x "$cxxbin"; then
  # build test case
  if "$cxxbin" -std=gnu++17 -c "$TESTSRC"; then
    # everything's fine
    exit 0
  fi
  # gcc can return exit codes outside of git's acceptable range, so...
  echo "Exited with $?" 1>&2 
  exit 1
else
  # No binary, skip broken builds with special 125 exit code
  exit 125
fi


             reply	other threads:[~2022-01-13 11:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 11:45 Alex Hornby [this message]
2022-01-13 12:36 ` Jonathan Wakely
2022-01-13 14:25   ` Alex Hornby
2022-01-13 17:29     ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW4PR15MB4444CB74DC3106008972CDD5D0529@MW4PR15MB4444.namprd15.prod.outlook.com \
    --to=ahornby@fb.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).