You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiled with a recent clang [clang version 7.0.0 (trunk 336548)], (-std=c++2a) it gives an error:
junk.cpp:8:5: error: defaulted definition of copy assignment operator is not
constexpr
constexpr span& operator=(const span&) noexcept = default;
^
However, if I switch the order of the two lines to:
~span() noexcept = default;
constexpr span& operator=(const span&) noexcept = default;
then it compiles w/o error.
However, I believe that it should compile w/o error in both cases.
The text was updated successfully, but these errors were encountered:
As shown above, the warning states that both assignment operators are not constexpr even though they are already declared constexpr, which is contradictory.
Extended Description
Consider this code:
class span {
public:
using pointer = const int *;
private:
pointer __data;
};
When compiled with a recent clang [clang version 7.0.0 (trunk 336548)], (-std=c++2a) it gives an error:
junk.cpp:8:5: error: defaulted definition of copy assignment operator is not
constexpr
constexpr span& operator=(const span&) noexcept = default;
^
However, if I switch the order of the two lines to:
~span() noexcept = default;
constexpr span& operator=(const span&) noexcept = default;
then it compiles w/o error.
However, I believe that it should compile w/o error in both cases.
The text was updated successfully, but these errors were encountered: