Clang Project

clang_source_code/test/SemaCXX/types_compatible_p.cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s
2// RUN: %clang_cc1 -fsyntax-only -x c %s
3
4// Test that GNU C extension __builtin_types_compatible_p() is not available in C++ mode.
5
6int f() {
7  return __builtin_types_compatible_p(int, const int); // expected-error{{expected '(' for function-style cast or type construction}} \
8                                                       // expected-error{{expected expression}}
9}
10