3 ms·
Same tokens? So you're saying 'inline int foo(void);' + 'typedef int I; inline I foo(void);' is UB?
by dataflow 5y ago
Same tokens? So you're saying 'inline int foo(void);' + 'typedef int I; inline I foo(void);' is UB?
- MauranKilom 5y agoQuoting the C++ 17 standard draft [0]: > There can be more than one definition in a program of [...an] inline function [...] as long as all of the following is true: > - each definition consists of the same sequence of tokens (typically, appears in the same header file) > [...] > If all these requirements are satisfied, the program behaves as if there is only one definition in the entire program. Otherwise, the program is ill-formed, no diagnostic required. [0]: https://timsong-cpp.github.io/cppwp/n4659/basic.def.odr#6.1 https://timsong-cpp.github.io/cppwp/n4659/basic.def.odr#6.1