]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaCXX/operator-arrow-temporary.cpp
Vendor import of clang trunk r162107:
[FreeBSD/FreeBSD.git] / test / SemaCXX / operator-arrow-temporary.cpp
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // PR9615
3
4 struct Resource {
5   void doit();
6 };
7
8 template<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
13 struct Accessor {
14   Lock<-1> operator->();
15 };
16
17 // Make sure we try to instantiate the destructor for Lock here
18 void f() { Accessor acc; acc->doit(); } // expected-note {{requested here}}
19