Issue 87490
Summary [clang] Objective-C encoding of `BOOL*` is wrong
Labels clang
Assignees
Reporter madsmtm
    The following program:

```objective-c
#import <stdio.h>

typedef signed char BOOL;
typedef signed char TYPEDEF;

int main() {
 printf("signed char* encoding: %s\n", @encode(signed char*));
 printf("TYPEDEF* encoding: %s\n", @encode(TYPEDEF*));
 printf("BOOL* encoding: %s\n", @encode(BOOL*));
    return 0;
}
```

Is supposed to output the following on x86_64 ([godbolt Clang 15](https://godbolt.org/z/dYrsheGd9), [Godbolt GCC 13.2](https://godbolt.org/z/zaj3hdqPo)):
```
signed char* encoding: *
TYPEDEF* encoding: *
BOOL* encoding: ^c
```

But since Clang 16, it outputs ([godbolt Clang 18](https://godbolt.org/z/9efxrnf3a)):
```
signed char* encoding: *
TYPEDEF* encoding: *
BOOL* encoding: *
```

---

Clang seemingly has code to support this, see https://github.com/llvm/llvm-project/blob/2bf7ddf06f773277fcfef58a3cd8c32a161ce36a/clang/lib/AST/ASTContext.cpp#L7696-L7704 and https://github.com/llvm/llvm-project/blob/2bf7ddf06f773277fcfef58a3cd8c32a161ce36a/clang/lib/AST/ASTContext.cpp#L8356-L8362, but for some reason these code paths are now no longer correctly triggered?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to