TGViewer
C++95 C++95 @cxx95 · 1.51K subscribers
Post #86 1.77K
#story

Кина не будет: цирк в комитете по C++ 🤹

Как я писал, в C++23 приняли аттрибут [[assume(expr)]]. Просматривая статус поддержки C++23 в Clang, я увидел что этот аттрибут пока не поддержан.

Я отправил патч на его поддержку - https://reviews.llvm.org/D144334

Это заняло мало времени и всего несколько строк в коде (не считая тестов и документации), потому что в Clang уже есть __builtin_assume, который сделан аналогично:
    case attr::Assume: {
llvm::Value *ArgValue = EmitScalarExpr(cast<AssumeAttr>(A)->getCond());
llvm::Function *FnAssume = CGM.getIntrinsic(llvm::Intrinsic::assume);
Builder.CreateCall(FnAssume, ArgValue);
break;
}

В ревью пришло несколько человек и началась клоунада. Оказывается, что представители Clang и MSVC на встречах комитета по стандартизации заявляли, что отказываются реализовывать эту фичу по разным причинам. Причины понятны - плохо полагаться на не описанное в стандарте поведение компилятора (в своем посте я описывал опасности).

Часть переписки по патчу:

erichkeane: So one thing to note here: I'm on the fence as to whether we want to implement this feature at all. As was discussed extensively during the EWG meetings on this: multiple implementers are against this attribute for a variety of reasons, and at least 1 other implementer has stated they might 'implementer veto' this. I think there is discussion to be had among the code owners here as to whether we even want this.

Izaron: I don't quite understand how it works. The feature has been approved for C++2b, but it should have not been approved if there were concerns from implementers. <...> Could you please elaborate: if you decide to not implement this feature, you will kind of revoke the proposal or just deliberately do not support a part of C++2b in Clang?

erichkeane: Just deliberately not support a part of C++2b. Implementers have veto'ed features in the past exactly that way.

aaron.ballman: Agreed, (IMO) it should not have been approved given how many implementer concerns were expressed. But what goes into the standard is whatever gains consensus in the committee, so the committee occasionally runs the risk of voting in something that won't be implemented. We try to avoid it whenever possible, but it still happens with some regularity.

Вот так! Деды из комитета могут принимать любые изменения, которые Clang и/или GCC и/или MSVC никогда не реализуют, просто по большинству голосов. Комитет всегда умеет удивить.
  • 🤡 17
  • 👍 3
  • 😱 3
  • 🔥 1
  • 😁 1
  • 🖕 1
More from @cxx95
  1. Sep 21, 2026#offtop Великое Мидревью 💼 В последнее время темы про C++ накапливаются медленно, и то та…
  2. Jun 17, 2026#jostik Обзор жостиков C++ 💼 (номер 5️⃣) В последние несколько месяцев совсем ничего не п…
  3. Jun 17, 2026document post
  4. Jan 7, 2026#compiler #ai На фото из марта 2024 - мерч с работы, это кофта и набор нашивок, которые мо…
  5. Jan 7, 2026document post
  6. Aug 18, 2025#books Текст в окружности - первые слова в опере (услышать) 🎤 📕 Обзор на книгу про памят…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →