blob: 8e79609342b51c7eb3d8ad5d92a6db33aaa5c45d [file] [log] [blame]
Eli Friedmand5931902011-04-04 01:18:25 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2// PR9615
3
4struct Resource {
5 void doit();
6};
7
8template<int x> struct Lock {
9 ~Lock() { int a[x]; } // expected-error {{declared as an array with a negative size}}
10 Resource* operator->() { return 0; }
11};
12
13struct Accessor {
14 Lock<-1> operator->();
15};
16
17// Make sure we try to instantiate the destructor for Lock here
18void f() { Accessor acc; acc->doit(); } // expected-note {{requested here}}
19