Welcome to mirror list, hosted at ThFree Co, Russian Federation.

address-of.cpp « SemaCXX « test « clang - github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a7e712b04c1db24bec7cb4c67181abde0a72bbac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR clang/3175

void bar(int*);

class c {
  int var;
  static int svar;
  void foo() { 
    bar(&var); 
    bar(&svar);  
  }

  static void wibble() {
    bar(&var); // expected-error{{invalid use of member 'var' in static member function}}
    bar(&svar); 
  }
};

enum E {
  Enumerator
};

void test() {
  (void)&Enumerator; // expected-error{{address expression must be an lvalue or a function designator}}
}

template<int N>
void test2() {
  (void)&N; // expected-error{{address expression must be an lvalue or a function designator}}
}

// PR clang/3222
void xpto();
void (*xyz)(void) = &xpto;