Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 6 years ago

Language

C++

Compiler

clang HEAD 8.0.0 (https://github.com/llvm-mirror/clang.git 2cbc69a72d96eceef21e55bbdcab75109ee310c3) (https://github.com/llvm-mirror/llvm.git b67d2d3f47f06fc5b6948662ddaaf78cdf02662f)

Options
Warnings
Don't Use Boost
C++2a
no pedantic

Author

anonymous

over 6 years ago

$ clang++ prog.cc -Wall -Wextra -std=c++2a
prog.cc:11:16: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr bool use() { 
               ^
prog.cc:13:5: note: non-constexpr function 'operator=' cannot be used in a constant expression
  a = b;
    ^
prog.cc:4:14: note: declared here
    Trivial& operator=(Trivial const&) = default;
             ^
prog.cc:17:15: error: static_assert expression is not an integral constant expression
static_assert(use());
              ^~~~~
prog.cc:13:5: note: non-constexpr function 'operator=' cannot be used in a constant expression
  a = b;
    ^
prog.cc:17:15: note: in call to 'use()'
static_assert(use());
              ^
prog.cc:4:14: note: declared here
    Trivial& operator=(Trivial const&) = default;
             ^
2 errors generated.
Exit Code:
1