[all-commits] [llvm/llvm-project] 226b0b: [Clang][C2y] Add support for if declarations (N335...

Muhammad Bassiouni via All-commits all-commits at lists.llvm.org
Tue Jul 14 12:16:53 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 226b0b59bfca58ef831bd668dcf219a79f11f957
      https://github.com/llvm/llvm-project/commit/226b0b59bfca58ef831bd668dcf219a79f11f957
  Author: Muhammad Bassiouni <60100307+bassiounix at users.noreply.github.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md
    M clang/docs/ReleaseNotes.md
    M clang/include/clang/Basic/DiagnosticParseKinds.td
    M clang/include/clang/Parse/Parser.h
    M clang/lib/Parse/ParseExprCXX.cpp
    M clang/lib/Parse/ParseOpenACC.cpp
    M clang/lib/Parse/ParseStmt.cpp
    A clang/test/C/C2y/n3267.c
    M clang/www/c_status.html

  Log Message:
  -----------
  [Clang][C2y] Add support for if declarations (N3356 paper) (#198244)

Add support for _if declarations_ in `C2y` mode by exploiting existing
C++ code.

The only new changes to the code is narrowing the code path to `C` mode
and introduce new errors and warnings for some pitfalls with the syntax
and what is expected from the standard and old language modes.

It should be noted that the first clause in the standard paper can only
be declaration. This means we can't allow expression statement in the
first clause of the condition, and that's the goal of the new
warnings/errors. Also this is different from C++ grammar.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list