[clang] [clang-repl] Extend the C support. (PR #89804)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 5 06:08:04 PDT 2024


hokein wrote:

@vgvassilev 

The reland d999ce0302f06d250f6d496b56a5a5f2dc331e61 makes the clang reject the valid code now:

```
$ cat /tmp/t33.cpp
#include <pthread.h>
#include <algorithm>

int main() {

}
                                                                                                                                      
$  ./bin/clang -Xclang -fsyntax-only -Xclang=-fincremental-extensions -stdlib=libc++ /tmp/t33.cpp                                      <<<
In file included from /tmp/t33.cpp:2:
In file included from /usr/include/c++/v1/algorithm:1712:
In file included from /usr/include/c++/v1/memory:877:
In file included from /usr/include/c++/v1/iterator:684:
In file included from /usr/include/c++/v1/__iterator/common_iterator.h:22:
/usr/include/c++/v1/variant:1024:43: error: use of undeclared identifier '__arg'; did you mean '_pthread_cleanup_buffer::__arg'?
 1024 |       } __impl{this, _VSTD::forward<_Arg>(__arg)};
      |                                           ^
/usr/include/pthread.h:162:9: note: '_pthread_cleanup_buffer::__arg' declared here
  162 |   void *__arg;                            /* Its argument.  */
      |         ^
In file included from /tmp/t33.cpp:2:
In file included from /usr/include/c++/v1/algorithm:1861:
In file included from /usr/include/c++/v1/__algorithm/ranges_stable_partition.h:15:
/usr/include/c++/v1/__algorithm/stable_partition.h:246:18: error: use of undeclared label '__second_half_done'
  246 |             goto __second_half_done;
      |                  ^
2 errors generated.
```

Can you take a look?

https://github.com/llvm/llvm-project/pull/89804


More information about the cfe-commits mailing list