コード例 #1
0
ファイル: temporaries.cpp プロジェクト: Bekenn/clang
const NonTrivial &getNonTrivialRef() {
  return NonTrivial(42); // expected-warning {{Address of stack memory associated with temporary object of type 'NonTrivial' returned to caller}}
}
コード例 #2
0
void bar() {
  POD b;
  b.b = 13;
  int c = foo(NonTrivial(), b);
}
コード例 #3
0
ファイル: temporaries.cpp プロジェクト: Bekenn/clang
NonTrivial getNonTrivial() {
  return NonTrivial(42); // no-warning
}