clang/test/Sema/c++-keyword-in-objc.m
raw| 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wc++-keyword %s |
| 2 | // expected-no-diagnostics |
| 3 | |
| 4 | // Show that we do not diagnose any C++ keywords in Objective-C. |
| 5 | |
| 6 | @class Foo; // Okay, Objective-C @ keyword, not a regular identifier |
| 7 | |
| 8 | // FIXME: it would be nice to diagnose this, but it is intentionally allowed |
| 9 | // due to @ and selectors allowing C++ keywords in ways that are supposed to be |
| 10 | // contextually compatible with C++. |
| 11 | int class = 12; |
| 12 |