llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.03k stars 11.58k forks source link

Deleted template inline friend function in template class causes redefinition error #34360

Open llvmbot opened 6 years ago

llvmbot commented 6 years ago
Bugzilla Link 35012
Version 5.0
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

When compiling the following code with clang++ -std=c++17 Test.cpp

template struct Test { template friend bool operator==(Test, U) = delete; }; Test test;

I get the following unexpected error:

clang++ -std=c++17 Test.cpp Test.cpp:4:15: error: redefinition of 'operator==' friend bool operator==(Test, U) = delete; ^ Test.cpp:6:11: note: in instantiation of template class 'Test' requested here Test test; ^ Test.cpp:4:15: note: previous definition is here friend bool operator==(Test, U) = delete; ^ 1 error generated.

GCC 7.2 produces no error.

CaseyCarter commented 2 years ago

mentioned in issue llvm/llvm-bugzilla-archive#43400

llvmbot commented 2 years ago

mentioned in issue llvm/llvm-bugzilla-archive#40150

llvmbot commented 1 year ago

@llvm/issue-subscribers-c-11

llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-frontend