Author
anonymous
about 3 years ago
Language
C++
Compiler
gcc 11.1.0
Options
Warnings
Don't Use Boost
C++2a
-pedantic-errors
Author
anonymous
about 3 years ago
$ g++ prog.cc -Wall -Wextra -std=c++2a -pedantic-errors
prog.cc: In function 'constexpr bool test1()':
prog.cc:28:49: error: call to non-'constexpr' function '_Tp* std::uninitialized_construct_using_allocator(_Tp*, const _Alloc&, _Args&& ...) [with _Tp = int; _Alloc = std::allocator<int>; _Args = {int}]'
28 | std::uninitialized_construct_using_allocator(&var, std::allocator<int>{}, 42);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/wandbox/gcc-11.1.0/include/c++/11.1.0/memory:87,
from prog.cc:2:
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/uses_allocator_args.h:215:5: note: '_Tp* std::uninitialized_construct_using_allocator(_Tp*, const _Alloc&, _Args&& ...) [with _Tp = int; _Alloc = std::allocator<int>; _Args = {int}]' declared here
215 | uninitialized_construct_using_allocator(_Tp* __p, const _Alloc& __a,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc: At global scope:
prog.cc:39:50: error: non-constant condition for static assertion
39 | static_assert(std::make_obj_using_allocator<bool>(std::allocator<bool>{}, true));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:39:50: error: call to non-'constexpr' function '_Tp std::make_obj_using_allocator(const _Alloc&, _Args&& ...) [with _Tp = bool; _Alloc = std::allocator<bool>; _Args = {bool}]'
In file included from /opt/wandbox/gcc-11.1.0/include/c++/11.1.0/memory:87,
from prog.cc:2:
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/uses_allocator_args.h:206:5: note: '_Tp std::make_obj_using_allocator(const _Alloc&, _Args&& ...) [with _Tp = bool; _Alloc = std::allocator<bool>; _Args = {bool}]' declared here
206 | make_obj_using_allocator(const _Alloc& __a, _Args&&... __args)
| ^~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:40:20: error: non-constant condition for static assertion
40 | static_assert(test1());
| ~~~~~^~
prog.cc:40:20: error: 'constexpr bool test1()' called in a constant expression
prog.cc:25:16: note: 'constexpr bool test1()' declared here
25 | constexpr bool test1()
| ^~~~~
Exit Code:
1