# GCCもClangも標準C++に準拠していない、と開発者が指摘

Original title: Neither GCC nor Clang are compliant with standard C++

> Hacker News story 48970039 · language: ja · submitted 2026-07-19
> Web version: https://zeli.app/ja/story/48970039
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 49 · by [birdculture](<https://news.ycombinator.com/user?id=birdculture>) · 💬 58
[original](<https://sebsite.pw/w/20260708-badstdcxx.html>) · [HN discussion](<https://news.ycombinator.com/item?id=48970039>)

## Summary

C++標準は、言語リンケージが異なる関数型は別の型であると明確に規定しています。しかし、GCCとClangはこの規則を実装しておらず、`extern "C"`で宣言された関数型と通常の関数型を同一視しています。このため、`static_assert`が失敗すべきところで成功したり、オーバーロードが誤ってODR違反とみなされたりします。開発者のsebsite.pw氏は、責任はコンパイラではなく標準側にあり、この挙動を実装定義に変更すべきだと主張します。ABIの破壊を避けるため、コンパイラは現状を変更できないとしています。

## Key quote

> GCCとClangは、型と言語リンケージの情報を保存しないため、異なる言語リンケージを持つ2つの関数が同一になることがあります。

---

## Cite

- Page: https://zeli.app/ja/story/48970039
- Date: 2026-07-19
- Source: sebsite.pw (https://sebsite.pw/w/20260708-badstdcxx.html)
- Hacker News: https://news.ycombinator.com/item?id=48970039

## Other languages

- en: https://zeli.app/story/48970039 · markdown: https://zeli.app/story/48970039.md
- zh: https://zeli.app/zh/story/48970039 · markdown: https://zeli.app/zh/story/48970039.md
- ko: https://zeli.app/ko/story/48970039 · markdown: https://zeli.app/ko/story/48970039.md
- de: https://zeli.app/de/story/48970039 · markdown: https://zeli.app/de/story/48970039.md
- es: https://zeli.app/es/story/48970039 · markdown: https://zeli.app/es/story/48970039.md
