]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/spellcheck-c++-11-keyword.C
Wrap option names in gcc internal messages with %< and %>.
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / spellcheck-c++-11-keyword.C
1 /* c++/77922: "constexpr" is only available from C++11 onwards.
2 We shouldn't offer it as a spellcheck suggestion in C++98. */
3 // { dg-options "-std=c++98" }
4
5 constexpr int a = 1; // { dg-bogus "did you mean" }
6 // { dg-error "'constexpr' does not name a type" "" { target *-*-* } .-1 }
7 // { dg-message "C\\+\\+11 'constexpr' only available with '-std=c\\+\\+11' or '-std=gnu\\+\\+11'" "" { target *-*-* } .-2 }
8
9 /* If the user typos "constexpr" (here as "consexpr"), don't offer it as a
10 spelling suggestion in C++98 mode. */
11 consexpr int a = 1; // { dg-bogus "did you mean" }
12 // { dg-error "'consexpr' does not name a type" "" { target *-*-* } .-1 }
13
14 decltype i = 0; // { dg-bogus "did you mean" }
15 // { dg-error "'decltype' does not name a type" "" { target *-*-* } .-1 }