Author
anonymous
almost 6 years ago
Language
C++
Compiler
clang 9.0.0
Options
Warnings
Don't Use Boost
C++17
-pedantic-errors
Author
anonymous
almost 6 years ago
$ clang++ prog.cc -Wall -Wextra -std=c++17 -pedantic-errors prog.cc:13:50: error: constexpr variable 'broken' must be initialized by a constant expression
constexpr std::initializer_list<const char*> broken { "but this doesn't?" };
^ ~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:13:50: note: pointer to subobject of temporary is not a constant expression
prog.cc:13:57: note: temporary created here
constexpr std::initializer_list<const char*> broken { "but this doesn't?" };
^
prog.cc:14:19: error: constexpr variable 'r2' must be initialized by a constant expression
constexpr int r2 = test_cexpr(broken);
^ ~~~~~~~~~~~~~~~~~~
prog.cc:14:35: note: initializer of 'broken' is not a constant expression
constexpr int r2 = test_cexpr(broken);
^
prog.cc:14:35: note: in call to 'initializer_list(broken)'
prog.cc:13:50: note: declared here
constexpr std::initializer_list<const char*> broken { "but this doesn't?" };
^
2 errors generated.
Exit Code:
1