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

[expr.const]p14 example incorrect after P1937R2 #3792

Closed
zygoloid opened this issue Feb 24, 2020 · 0 comments
Closed

[expr.const]p14 example incorrect after P1937R2 #3792

zygoloid opened this issue Feb 24, 2020 · 0 comments
Milestone

Comments

@zygoloid
Copy link
Member

After the application of P1937R2, this example from the end of [expr.const]p14 is no longer correct or useful:

[ Example:

struct N {
  constexpr N() {}
  N(N const&) = delete;
};
template<typename T> constexpr void bad_assert_copyable() { T t; T t2 = t; }
using ineffective = decltype(bad_assert_copyable<N>());
                        // bad_­assert_­copyable<N> is not needed for constant evaluation
                        // (and thus not instantiated)
template<typename T> consteval void assert_copyable() { T t; T t2 = t; }
using check = decltype(assert_copyable<N>());
                        // error: assert_­copyable<N> is instantiated (because it is needed for constant
                        // evaluation), but the attempt to copy t is ill-formed

end example ]

The distinction it's trying to draw attention to was removed by P1937R2, so let's just remove the example rather than trying to fix it.

@zygoloid zygoloid added this to the C++20 milestone Feb 24, 2020
jwakely referenced this issue Feb 27, 2020
P1937R2 Fixing inconsistencies between constexpr and consteval functions
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