更新时间:2022-06-22 23:57:20
C ++ 0X draft N3225在 2函数说明符
:
C++0X draft N3225 says in 7.1.2 Function specifiers
:
语句2:内联函数
第4条:内联函数应在其使用的每个转换单元中定义,完全相同的定义在每种情况下。
clause 2: A function declaration with an inline specifier declares an inline function
clause 4: An inline function shall be defined in every translation unit in which it is odr-used and shall have exactly the same definition in every case.
; clang错误,但仍有一个(slim)的机会,在C ++ 03中的东西是不同的。
So, to me, it looks like gcc is right & clang wrong, but there's still a (slim) chance that things were (are?) different in C++03..