resolve #17, fix wrong description and example for constexpr

This commit is contained in:
Changkun Ou
2018-04-19 09:48:44 +02:00
parent a2c90ba7df
commit 2e63a68751
3 changed files with 15 additions and 12 deletions

View File

@@ -38,7 +38,9 @@ int main() {
// char arr_3[len]; // illegal
const int len_2 = len + 1;
char arr_4[len_2]; // legal
constexpr int len_2_constexpr = 1 + 2 + 3;
// char arr_4[len_2]; // illegal, but ok for most of the compilers
char arr_4[len_2_constexpr]; // legal
// char arr_5[len_foo()+5]; // illegal
char arr_6[len_foo_constexpr() + 1]; // legal

View File

@@ -1,7 +1,7 @@
all: $(patsubst %.cpp, %.out, $(wildcard *.cpp))
%.out: %.cpp Makefile
clang++ $< -o $@ -std=c++17
clang++ $< -o $@ -std=c++17 -pedantic
clean:
rm *.out