aboutsummaryrefslogtreecommitdiff
path: root/openmp/runtime/src/z_Linux_util.cpp
diff options
context:
space:
mode:
authorKrystian Stasiowski <sdkrystian@gmail.com>2023-12-11 09:35:57 -0500
committerGitHub <noreply@github.com>2023-12-11 06:35:57 -0800
commit29bd78b2f61e638f6c26bc417ae476754b91e985 (patch)
treee9fa508637c488c02c826b5f94bf8f2c60ad6013 /openmp/runtime/src/z_Linux_util.cpp
parent9071a15d4b90be1c0f57b6d7540097662b31963a (diff)
downloadllvm-29bd78b2f61e638f6c26bc417ae476754b91e985.zip
llvm-29bd78b2f61e638f6c26bc417ae476754b91e985.tar.gz
llvm-29bd78b2f61e638f6c26bc417ae476754b91e985.tar.bz2
[Clang][Sema] Diagnose friend function specialization definitions (#72863)
Per [[class.friend]p6](http://eel.is/c++draft/class.friend#6) a friend function shall not be defined if its name isn't unqualified. A _template-id_ is not a name, meaning that a friend function specialization does not meet this criteria and cannot be defined. GCC, MSVC, and EDG all consider friend function specialization definitions to be invalid de facto explicit specializations and diagnose them as such. Instantiating a dependent friend function specialization definition [currently sets off an assert](https://godbolt.org/z/Krqdq95hY) in `FunctionDecl::setFunctionTemplateSpecialization`. This happens because we do not set the `TemplateSpecializationKind` of the `FunctionDecl` created by template argument deduction to `TSK_ExplicitSpecialization` for friend functions [here](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaTemplate.cpp#L9600). I changed the assert condition because I believe this is the correct behavior.
Diffstat (limited to 'openmp/runtime/src/z_Linux_util.cpp')
0 files changed, 0 insertions, 0 deletions