sepavloff added a comment. The issue is still observed in trunk. Other compilers process the tests correctly (checked using https://godbolt.org/). For instance, the code:
template<typename T> struct C20 { friend void func_20() {} // expected-note{{previous definition is here}} }; C20<int> c20i; void func_20() {} // expected-error{{redefinition of 'func_20'}} is rejected by gcc 7.3: <source>: In function 'void func_20()': <source>:5:6: error: redefinition of 'void func_20()' void func_20() {} // expected-error{{redefinition of 'func_20'}} ^~~~~~~ <source>:2:13: note: 'void func_20()' previously declared here friend void func_20() {} // expected-note{{previous definition is here}} ^~~~~~~ Compiler returned: 1 by ICC 18: <source>(5): error: function "func_20" has already been defined void func_20() {} // expected-error{{redefinition of 'func_20'}} ^ compilation aborted for <source> (code 2) Compiler returned: 2 and by MSVC 19 2017: <source>(5): error C2084: function 'void C20<int>::func_20(void)' already has a body <source>(2): note: see previous definition of 'func_20' Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25017 for x64 Copyright (C) Microsoft Corporation. All rights reserved. Compiler returned: 2 https://reviews.llvm.org/D30170 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits