[cfe-dev] Type as written is lost here?

Abramo Bagnara abramo.bagnara at gmail.com
Fri Dec 24 00:46:48 PST 2010


$ cat z.c
typedef void *f();

f a;
f b __attribute__((noreturn));

void g(f m);
void h(f m __attribute__((noreturn)));
$ clang -cc1 -ast-dump z.c
typedef char *__builtin_va_list;
typedef void *(f)();
f a;
void *b() __attribute((noreturn));
void g(f m);
void h(void *(m)() __attribute__((noreturn)));


In the declarations for b and h the use of typedef f is lost.

I guess this is due to the fact that noreturn attribute is applied to
function type and not to declaration (despite the fact that it is
available in the declaration).

What about to introduce an AttributedTypeLoc (or to add attributes to
QualifiedTypeLoc)?



More information about the cfe-dev mailing list