Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/warn/string1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/35652 |
131 | 2 // { dg-options "-O -Wall" } |
111 | 3 |
4 #include <string> | |
5 int test() { | |
6 // blank line padding, could also be code... | |
7 // | |
8 // | |
9 // | |
10 // | |
11 // | |
12 // | |
13 // | |
14 // | |
15 // | |
16 std::string s = ""; | |
17 s += 'x' + "y"; // { dg-warning "bounds of constant string" } | |
131 | 18 |
19 return 0; | |
111 | 20 } |
131 | 21 |
22 // With -std=c++17 we get another warning deep under operator+=. | |
23 // { dg-prune-output __builtin_memcpy } |