summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/spellcheck-c++-11-keyword.C
blob: 0984af9d72e6d09375616613ecc24ad06d206196 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* c++/77922: "constexpr" is only available from C++11 onwards.
   We shouldn't offer it as a spellcheck suggestion in C++98.  */
// { dg-options "-std=c++98" }

constexpr int a = 1; // { dg-bogus "did you mean" }
// { dg-error ".constexpr. does not name a type" "" { target *-*-* } .-1 }
// { dg-message "C\\+\\+11 .constexpr. only available with -std=c\\+\\+11 or -std=gnu\\+\\+11" "" { target *-*-* } .-2 }

/* If the user typos "constexpr" (here as "consexpr"), don't offer it as a
   spelling suggestion in C++98 mode.  */
consexpr int a = 1; // { dg-bogus "did you mean" }
// { dg-error ".consexpr. does not name a type" "" { target *-*-* } .-1 }

decltype i = 0; // { dg-bogus "did you mean" }
// { dg-error ".decltype. does not name a type" "" { target *-*-* } .-1 }