Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve compiler issues for common compiler configurations #42

Open
jwhpryor opened this issue Feb 3, 2023 · 2 comments
Open

Resolve compiler issues for common compiler configurations #42

jwhpryor opened this issue Feb 3, 2023 · 2 comments
Assignees
Milestone

Comments

@jwhpryor
Copy link
Collaborator

jwhpryor commented Feb 3, 2023

Some common compilers (such as those bundled with the Android NDK on stock Bazel) have outdated or non-conformant clang implementations.

Some of these legal but unsupported syntaxes could be obviated with equivalent but supported implementations.

@jwhpryor
Copy link
Collaborator Author

Some of this may be impossible without either changing the call syntax or waiting until the library can support C++20.

There are a couple alternatives:

  1. Provide a slower solution for non-clang alternatives. This could likely be reduced to a single dereference per method invocation (the correct idx can still be inferred compile time).
  2. A syntax that explicitly requires providing the idx as a template argument based on a constexpr method invoked from the constexpr class. E.g.

LocalObject<kClass> obj {}.Call<kClass.idx("Foo">(...);

This introduces a lot of duplication and isn't visually appealing.

  1. Wait until C++ 20string literals are available and cut a library release that isn't backwards compatible.

Relevant links:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0424r2.pdf
http://je4d.s3.amazonaws.com/D0732R0-wip.pdf
https://artificial-mind.net/blog/2020/11/14/cpp17-consteval

Even still, this option may require a new syntax because operators can't be cleanly templated. E.g. you may need to write the syntax:

obj.template<"Foo">( ... );

Here at least we could offer a new syntax:

obj.Call<"Foo">( ... );

This would maintain dual compatibility but would be sad to introduce a new call syntax. It's unclear to me if consteval could provide a consistent syntax to what exists today.

  1. Look for a gcc equivalent of the function argument enable_if. This isn't particularly good long term either though.

What's unfortunate is that the correct idx can be inferred at compile time at the call site, but not once the member method has been invoked. C++17 has everything it needs.

I don't think this is trivial to resolve, so, I will leave this as an open problem, but not blocking for release. I tried every trick I had.

@jwhpryor jwhpryor removed the Release label Mar 23, 2023
@jwhpryor jwhpryor removed this from the Release 1.0 milestone Nov 18, 2023
@jwhpryor jwhpryor self-assigned this Feb 24, 2024
@jwhpryor jwhpryor added this to the Release 2.0 milestone Mar 18, 2024
@jwhpryor jwhpryor mentioned this issue Nov 14, 2024
@jwhpryor
Copy link
Collaborator Author

After some extensive digging, I'm now convinced the existing syntax will be impossible to support in other compiler implementations.

I'm going to add two new functions when C++20 (or higher) is present with syntax like so:

LocalObject<kObj> obj {};
obj.Call<"yourJavaFunctionName">( ... ) ;
obj.Access<"yourJavaFunctionName">( ... ) ;

I will leave the existing syntax available when clang is present, since these functions can peacefully co-exist (and will even be able to share the other's cacheing).

I'm disappointed maintaining the existing syntax isn't possible going but I think this strikes the best balance for compatibility.

copybara-service bot pushed a commit that referenced this issue Dec 29, 2024
This flavour no longer requires a clang extension and so should unlock other compilers.

In a downstream CL I will add this to ObjectRef to enable the new syntax and eventually update existing usage.

#42

PiperOrigin-RevId: 710513656
copybara-service bot pushed a commit that referenced this issue Dec 30, 2024
Sadly, the syntax the clang extension offers cannot be reproduced with standard C++20. These new map types will allow for C++20 support on non-clang compilers.

#42

PiperOrigin-RevId: 710765161
copybara-service bot pushed a commit that referenced this issue Dec 30, 2024
Sadly, the syntax the clang extension offers cannot be reproduced with standard C++20. These new map types will allow for C++20 support on non-clang compilers.

#42

PiperOrigin-RevId: 710765161
copybara-service bot pushed a commit that referenced this issue Dec 30, 2024
Sadly, the syntax the clang extension offers cannot be reproduced with standard C++20. These new map types will allow for C++20 support on non-clang compilers.

#42

PiperOrigin-RevId: 710765161
copybara-service bot pushed a commit that referenced this issue Dec 30, 2024
Sadly, the syntax the clang extension offers cannot be reproduced with standard C++20. These new map types will allow for C++20 support on non-clang compilers.

#42

PiperOrigin-RevId: 710765161
copybara-service bot pushed a commit that referenced this issue Dec 30, 2024
Sadly, the syntax the clang extension offers cannot be reproduced with standard C++20. These new map types will allow for C++20 support on non-clang compilers.

#42

PiperOrigin-RevId: 710765161
copybara-service bot pushed a commit that referenced this issue Dec 30, 2024
This flavour no longer requires a clang extension and so should unlock other compilers.

I'm keeping this in a separate CL since it's the first time both C++17 and C++20 versions for code in use and would like to flush out build failures.

In a downstream CL I will add this to `ObjectRef` to enable the new syntax and eventually update existing usage.

#42

PiperOrigin-RevId: 710778389
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
This flavour no longer requires a clang extension and so should unlock other compilers.

I'm keeping this in a separate CL since it's the first time both C++17 and C++20 versions for code in use and would like to flush out build failures.

In a downstream CL I will add this to `ObjectRef` to enable the new syntax and eventually update existing usage.

#42

PiperOrigin-RevId: 710778389
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
#42

These changes were largely made by agent with the following prompt: "Observe the changes I have made replacing uses of () and [] operator member methods, and moved them to .Call and .Access respectively.  Replicate those replacements throughout the file where needed. Don't add uses of Ptr() where they don't exist."

PiperOrigin-RevId: 710513656
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
This flavour no longer requires a clang extension and so should unlock other compilers.

I'm keeping this in a separate CL since it's the first time both C++17 and C++20 versions for code in use and would like to flush out build failures.

In a downstream CL I will add this to `ObjectRef` to enable the new syntax and eventually update existing usage.

#42

PiperOrigin-RevId: 710778389
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
Sadly, the syntax the clang extension offers cannot be reproduced with standard C++20. These new map types will allow for C++20 support on non-clang compilers.

#42

PiperOrigin-RevId: 710765161
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
Sadly, the syntax the clang extension offers cannot be reproduced with standard C++20. These new map types will allow for C++20 support on non-clang compilers.

#42

PiperOrigin-RevId: 710765161
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
This flavour no longer requires a clang extension and so should unlock other compilers.

I'm keeping this in a separate CL since it's the first time both C++17 and C++20 versions for code in use and would like to flush out build failures.

In a downstream CL I will add this to `ObjectRef` to enable the new syntax and eventually update existing usage.

#42

PiperOrigin-RevId: 710778389
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
#42

These changes were largely made by agent with the following prompt: "Observe the changes I have made replacing uses of () and [] operator member methods, and moved them to .Call and .Access respectively.  Replicate those replacements throughout the file where needed. Don't add uses of Ptr() where they don't exist."

PiperOrigin-RevId: 710513656
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
This flavour no longer requires a clang extension and so should unlock other compilers.

I'm keeping this in a separate CL since it's the first time both C++17 and C++20 versions for code in use and would like to flush out build failures.

In a downstream CL I will add this to `ObjectRef` to enable the new syntax and eventually update existing usage.

#42

PiperOrigin-RevId: 710778389
copybara-service bot pushed a commit that referenced this issue Dec 31, 2024
#42

These changes were largely made by agent with the following prompt: "Observe the changes I have made replacing uses of () and [] operator member methods, and moved them to .Call and .Access respectively.  Replicate those replacements throughout the file where needed. Don't add uses of Ptr() where they don't exist."

PiperOrigin-RevId: 710513656
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction` and `lambda_compatible` which depended on the full form. Since they are not used I will just remove them.

#42

PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction` and `lambda_compatible` which depended on the full form. Since they are not used I will just remove them.

#42

PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction` and `lambda_compatible` which depended on the full form. Since they are not used I will just remove them.

#42

PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 3, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
#42

These changes were largely made by agent with the following prompt: "Observe the changes I have made replacing uses of () and [] operator member methods, and moved them to .Call and .Access respectively.  Replicate those replacements throughout the file where needed. Don't add uses of Ptr() where they don't exist."

PiperOrigin-RevId: 711312812
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
#42

These changes were largely made by agent with the following prompt: "Observe the changes I have made replacing uses of () and [] operator member methods, and moved them to .Call and .Access respectively.  Replicate those replacements throughout the file where needed. Don't add uses of Ptr() where they don't exist."

PiperOrigin-RevId: 711312812
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
In a follow up CL all of these tests will be the only tests run on C++17 GitHub actions.

Without these tests there would be no test coverage for C++17 after the project migrates to C++20 syntax.

Also drive by cleanup of clang-tidy failures.

#42

PiperOrigin-RevId: 711214863
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
In a follow up CL all of these tests will be the only tests run on C++17 GitHub actions.

Without these tests there would be no test coverage for C++17 after the project migrates to C++20 syntax.

Also drive by cleanup of clang-tidy failures.

#42

PiperOrigin-RevId: 711214863
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

Pack discriminator only operates on types and const auto&.  This had inconsistent behaviour across compilers, and Ubuntu + C++20 specifically breaks.  A similar issue was encountered a while back when trying to support Windows, which was what motivated the "diminished" forms.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 4, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

Pack discriminator only operates on types and const auto&.  This had inconsistent behaviour across compilers, and Ubuntu + C++20 specifically breaks.  A similar issue was encountered a while back when trying to support Windows, which was what motivated the "diminished" forms.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
copybara-service bot pushed a commit that referenced this issue Jan 5, 2025
As the matrix of supported compilers an increasing number of compiler inconsistencies are unfortunately showing, both across clang and gcc, but also across platforms (mac and Linux) and versions (C++17 and C++20).

gcc does not seem to permit template specialisations within class definitions so inner helper classes have been moved out of classes (despite the current form being cleaner).

`InvocableMap`s have been updated not to have derived non-type template parameters, so they're now just passed as explicit types. This is objectively absurd, as what I wrote is valid C+++ and gcc should know better, but it just straight up segfaults so better luck next time gcc.

Also removed `conjunction`, `lambda_compatible`, and `type_map` which depended on the full form or needed clang Since they are not used I will just remove them.

Also, gcc seems to take issue with using declarations that shadow types in the outer namespace, so they have been modified with a leading "_", e.g. "using _ExposedType = ...".

Pack discriminator only operates on types and const auto&.  This had inconsistent behaviour across compilers, and Ubuntu + C++20 specifically breaks.  A similar issue was encountered a while back when trying to support Windows, which was what motivated the "diminished" forms.

#42

Tested: Compiled on Ubuntu and Mac platforms with C++20 using clang and gcc.
PiperOrigin-RevId: 711515926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant