}
NamedDecl *dcl = getPrimaryDecl(op);
Expr::isLvalueResult lval = op->isLvalue(Context);
-
+ printf("oleee\n");
if (lval != Expr::LV_Valid) { // C99 6.5.3.2p1
if (!dcl || !isa<FunctionDecl>(dcl)) {// allow function designators
// FIXME: emit more specific diag...
return Context.OverloadTy;
} else if (isa<FieldDecl>(dcl)) {
// Okay: we can take the address of a field.
+ } else if (isa<FunctionDecl>(dcl)) {
+ // Okay: we can take the address of a function.
}
- else
+ else
assert(0 && "Unknown/unexpected decl type");
}
-// RUN: clang -fsyntax-only -verify %S
+// RUN: clang -fsyntax-only -verify %s
// PR clang/3175
void bar(int*);
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;