================
@@ -4243,8 +4243,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&OldD, Scope *S,
// used on the first declaration of that function in the translation
unit.
// Redeclarations of the function in the same translation unit may
// optionally use SYCL_EXTERNAL, but this is not required.
+ // The attribute is ignored and dropped for a variadic function, so 'Old'
+ // won't have it; 'New' still does since the drop happens after this check.
const SYCLExternalAttr *SEA = New->getAttr<SYCLExternalAttr>();
- if (SEA && !Old->hasAttr<SYCLExternalAttr>()) {
+ if (SEA && !New->isVariadic() && !Old->hasAttr<SYCLExternalAttr>()) {
----------------
schittir wrote:
That's what I'd wanted to do ( andpushed something similar to one of the
earlier commits
https://github.com/llvm/llvm-project/pull/216393/commits/fbed1e75c687dd652c64b95cc81b9a353ae9078f)
before reverting it back to favor the older design
(https://github.com/llvm/llvm-project/pull/216393/commits/519113cc345eed13dd22b0f2ca67bbdbbb6f17b5),
which I thought you'd preferred. I'll make the switch to use the handler
design.
https://github.com/llvm/llvm-project/pull/216393
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits