view gcc/testsuite/g++.dg/warn/string1.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

// PR c++/35652
// { dg-options "-O -Wall" }

#include <string>
int test() {
  // blank line padding, could also be code...
  //
  //
  //
  //
  //
  //
  //
  //
  //
  std::string s = "";
  s += 'x' + "y";	      // { dg-warning "bounds of constant string" }

  return 0;
}

// With -std=c++17 we get another warning deep under operator+=.
// { dg-prune-output __builtin_memcpy }