public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly
@ 2023-04-25 21:52 sjames at gcc dot gnu.org
  2023-04-25 21:59 ` [Bug c++/109625] " arsen at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-25 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109625
           Summary: [14 regression] 'error: use of built-in trait
                    ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’
                    in function signature; use library traits instead'
                    when building folly
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: arsen at gcc dot gnu.org, ppalka at gcc dot gnu.org
  Target Milestone: ---

Created attachment 54917
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54917&action=edit
Unicode.cpp.ii.xz

Not sure if this is a GCC issue or not, but it's a new compile failure of
folly-2023.04.10.00 with GCC 14.0.0 20230423:
```
FAILED: CMakeFiles/folly_base.dir/folly/Unicode.cpp.o 
/usr/bin/aarch64-unknown-linux-gnu-g++ -DBOOST_ATOMIC_DYN_LINK
-DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB
-DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB
-DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB
-DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK
-DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB
-DFMT_SHARED
-DFOLLY_XLOG_STRIP_PREFIXES=\"/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00:/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00_build\"
-DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT
-I/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00
-I/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00_build
-I/usr/include/libiberty  -O2 -pipe -mcpu=native -fPIC -fcoroutines -g
-std=gnu++1z -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated
-Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized
-Wunused-label -Wunused-result -Wshadow-compatible-local -Wno-noexcept-type
-faligned-new -fopenmp -std=gnu++17 -MD -MT
CMakeFiles/folly_base.dir/folly/Unicode.cpp.o -MF
CMakeFiles/folly_base.dir/folly/Unicode.cpp.o.d -o
CMakeFiles/folly_base.dir/folly/Unicode.cpp.o -c
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Unicode.cpp
In file included from
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Unicode.cpp:21:
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Conv.h:
In instantiation of ‘folly::detail::LastElement<Ts ...>&
folly::detail::getLastElement(const Ts& ...) [with Ts = {char [26], unsigned
int, char [4], unsigned int, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >*}]’:
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Conv.h:312:27:
error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T
...>’ in function signature; use library traits instead
  312 | const LastElement<Ts...>& getLastElement(const Ts&... ts) {
      |                           ^~~~~~~~~~~~~~
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Conv.h:
In instantiation of ‘folly::detail::LastElement<Ts ...>&
folly::detail::getLastElement(const Ts& ...) [with Ts = {char [26], unsigned
int, char [6], unsigned int, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >*}]’:
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Conv.h:312:27:
error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T
...>’ in function signature; use library traits instead
[...]
```

---

```
$ /usr/bin/aarch64-unknown-linux-gnu-g++ -O2 -fcoroutines -std=gnu++1z
-finput-charset=UTF-8 -fsigned-char -faligned-new -fopenmp -std=gnu++17 -c
Unicode.cpp.ii
In file included from
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Unicode.cpp:21:
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Conv.h:
In instantiation of ‘folly::detail::LastElement<Ts ...>&
folly::detail::getLastElement(const Ts& ...) [with Ts = {char [26], unsigned
int, char [4], unsigned int, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >*}]’:
/var/tmp/portage/dev-cpp/folly-2023.04.10.00/work/folly-2023.04.10.00/folly/Conv.h:312:27:
error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T
...>’ in function signature; use library traits instead
  312 | const LastElement<Ts...>& getLastElement(const Ts&... ts) {
      |                           ^~~~~~~~~~~~~~
[...]
```

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

* [Bug c++/109625] [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly
  2023-04-25 21:52 [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly sjames at gcc dot gnu.org
@ 2023-04-25 21:59 ` arsen at gcc dot gnu.org
  2023-04-25 22:03 ` arsen at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-04-25 21:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
related code (folly/Traits.h)


  #if FOLLY_HAS_BUILTIN(__type_pack_element)

  template <std::size_t I, typename... Ts>
  using type_pack_element_t = __type_pack_element<I, Ts...>;

  #else

  template <std::size_t I, typename... Ts>
  using type_pack_element_t = traits_detail::type_pack_element_fallback<I,
Ts...>;

  #endif

it is what it says on the tin :)

do we want to match what clang does here?  that being:

~ 1 $ clang++ -x c++ - -S -o - <<<$'template<class... T> void
FOOBAR(__type_pack_element<4, T...>&&) {} void g() { FOOBAR<int, int, int, int,
double>(3.0); }' | grep FOOBAR
        callq   _Z6FOOBARIJiiiidEEvO19__type_pack_elementILm4EJDpT_EE

... not the prettiest

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

* [Bug c++/109625] [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly
  2023-04-25 21:52 [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly sjames at gcc dot gnu.org
  2023-04-25 21:59 ` [Bug c++/109625] " arsen at gcc dot gnu.org
@ 2023-04-25 22:03 ` arsen at gcc dot gnu.org
  2023-04-25 22:05 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-04-25 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
almost certainly started with r14-92-g58b7dbf865b146, of course

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

* [Bug c++/109625] [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly
  2023-04-25 21:52 [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly sjames at gcc dot gnu.org
  2023-04-25 21:59 ` [Bug c++/109625] " arsen at gcc dot gnu.org
  2023-04-25 22:03 ` arsen at gcc dot gnu.org
@ 2023-04-25 22:05 ` pinskia at gcc dot gnu.org
  2023-04-26  6:24 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-25 22:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Folly should not use internal functions which is not designed for other than
libstdc++.

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

* [Bug c++/109625] [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly
  2023-04-25 21:52 [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly sjames at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-04-25 22:05 ` pinskia at gcc dot gnu.org
@ 2023-04-26  6:24 ` rguenth at gcc dot gnu.org
  2023-04-26  8:40 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-26  6:24 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug c++/109625] [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly
  2023-04-25 21:52 [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly sjames at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-04-26  6:24 ` rguenth at gcc dot gnu.org
@ 2023-04-26  8:40 ` redi at gcc dot gnu.org
  2023-04-26  8:41 ` redi at gcc dot gnu.org
  2023-04-26 20:48 ` sjames at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2023-04-26  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Arsen Arsenović from comment #1)
> do we want to match what clang does here?

No, this is an intentional choice.

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

* [Bug c++/109625] [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly
  2023-04-25 21:52 [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly sjames at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-04-26  8:40 ` redi at gcc dot gnu.org
@ 2023-04-26  8:41 ` redi at gcc dot gnu.org
  2023-04-26 20:48 ` sjames at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2023-04-26  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> Folly should not use internal functions which is not designed for other than
> libstdc++.

The function wasn't designed for libstdc++, Clang had it first.

But Folly shouldn't assume that non-standard extensions have a
consistent/portable mangling suitable for use in APIs. In this case, it can't
be mangled at all.

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

* [Bug c++/109625] [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly
  2023-04-25 21:52 [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly sjames at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-04-26  8:41 ` redi at gcc dot gnu.org
@ 2023-04-26 20:48 ` sjames at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-26 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |MOVED
             Status|UNCONFIRMED                 |RESOLVED
           See Also|                            |https://github.com/facebook
                   |                            |/folly/issues/1991

--- Comment #6 from Sam James <sjames at gcc dot gnu.org> ---
Thanks folks. Moving to https://github.com/facebook/folly/issues/1991.

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

end of thread, other threads:[~2023-04-26 20:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-25 21:52 [Bug c++/109625] New: [14 regression] 'error: use of built-in trait ‘__type_pack_element<sizeof ... (T ...) - 1, T ...>’ in function signature; use library traits instead' when building folly sjames at gcc dot gnu.org
2023-04-25 21:59 ` [Bug c++/109625] " arsen at gcc dot gnu.org
2023-04-25 22:03 ` arsen at gcc dot gnu.org
2023-04-25 22:05 ` pinskia at gcc dot gnu.org
2023-04-26  6:24 ` rguenth at gcc dot gnu.org
2023-04-26  8:40 ` redi at gcc dot gnu.org
2023-04-26  8:41 ` redi at gcc dot gnu.org
2023-04-26 20:48 ` sjames 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).