blob: 4e436d6e98b2ce1aaea550fdc836e75233625864 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Douglas Gregor29882052008-12-10 21:26:49 +00002// PR clang/3175
3
4void bar(int*);
5
6class c {
7 int var;
8 static int svar;
9 void foo() {
10 bar(&var);
11 bar(&svar);
12 }
13
14 static void wibble() {
15 bar(&var); // expected-error{{invalid use of member 'var' in static member function}}
16 bar(&svar);
17 }
18};
19
20enum E {
21 Enumerator
22};
23
24void test() {
25 (void)&Enumerator; // expected-error{{address expression must be an lvalue or a function designator}}
26}
27
28template<int N>
29void test2() {
30 (void)&N; // expected-error{{address expression must be an lvalue or a function designator}}
31}
Nuno Lopes6fea8d22008-12-16 22:58:26 +000032
33// PR clang/3222
34void xpto();
35void (*xyz)(void) = &xpto;