History

__typeof(t) should not include storage modifiers of t

Joe Soroka committed 15 years ago

Commit 38cbb401 parent 5d556472 files · +7 −0Browse files

Unified · Split

2 files
  1. tccgen.c +2 −0
  2. tests/tcctest.c +5 −0
tccgen.c+2−0
@@ -2948,6 +2948,8 @@ static int parse_btype(CType *type, AttributeDef *ad) · 2947 unmodified lines
29482948 case TOK_TYPEOF3:
29492949 next();
29502950 parse_expr_type(&type1);
2951+ /* remove all storage modifiers except typedef */
2952+ type1.t &= ~(VT_STORAGE&~VT_TYPEDEF);
29512953 goto basic_type2;
29522954 default:
29532955 if (typespec_found || typedef_found)
tests/tcctest.c+5−0
@@ -2365,6 +2365,11 @@ extern int weak_asm_v1 asm("weak_asm_v1x") __attribute · 2364 unmodified lines
23652365 extern int __attribute((weak)) weak_asm_v2 asm("weak_asm_v2x") ;
23662366 extern int __attribute((weak)) weak_asm_v3(void) asm("weak_asm_v3x") __attribute((weak));
23672367
2368+static const size_t dummy = 0;
2369+extern __typeof(dummy) weak_dummy1 __attribute__((weak, alias("dummy")));
2370+extern __typeof(dummy) __attribute__((weak, alias("dummy"))) weak_dummy2;
2371+extern __attribute__((weak, alias("dummy"))) __typeof(dummy) weak_dummy3;
2372+
23682373 void __attribute__((weak)) weak_test(void)
23692374 {
23702375 printf("weak_f1=%d\n", weak_f1 ? weak_f1() : 123);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t