Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 8 years ago

Language

Compiler

Options

Author

anonymous

almost 8 years ago

$
prog.cc:19:19: error: constexpr variable 'i' must be initialized by a constant expression
    constexpr int i = Foo(false); // ERROR: appear in a constant expression
                  ^   ~~~~~~~~~~
prog.cc:11:18: note: a constant expression cannot modify an object that is visible outside that expression
    return global++;
                 ^
prog.cc:19:23: note: in call to 'Foo(false)'
    constexpr int i = Foo(false); // ERROR: appear in a constant expression
                      ^
1 error generated.
Exit Code:
1