Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / lookup / new1.C
blob11a6d97ddf7829816997c04cb8ad353c92628a7e
1 // { dg-do compile }
2 // Origin: <igodard at rational dot com>
3 // PR c++/2518: operator new must not be looked up in local scope
5 int main() {
6   int i;
7   void* operator new(__SIZE_TYPE__ s, int* p);
8   int* e = new(&i) int;                    // { dg-error "no matching function" }
9   // { dg-message "candidate" "candidate note" { target *-*-* } 8 }
10   int* f = new int;
11   return 0;
14 // { dg-message "operator new|candidate expects" "" { target *-*-* } 0 }