Skip to content

Lexer/__has_declspec_attribute regression in Clang 14 #53269

@lilianmoraru

Description

@lilianmoraru

Regression tracked to this commit: 2edb89c#diff-d8dd6191130efea27aca1a54b23fc45eeeb1cc377147f9d6f5ec8b00ff56fafc
Confirmed that reverting 2edb89c746848c52964537268bf03e7906bf2542 on d8e0e125a2ff03335838039f5d33ecd61dfec654(main branch/clang 14) fixes the bug.

Description:

libcurl 7.78.0(the line was there for years, it's not specific to this version) fails to compile when consumed in a C++ project(unknown if specific to C++ - this was the initial setup when the issue was hit):

linux/include/curl/curl.h:120:41: error: too few arguments provided to function-like macro invocation
      __has_declspec_attribute(dllimport))
                                        ^

Clang 13.0.1(release/13.x branch) works fine.
Clang 14(d8e0e125a2ff03335838039f5d33ecd61dfec654, branch main) fails.

This is the line upstream:
https://github.com/curl/curl/blob/bfbde883af33397943df68a3ae01847a634d33bf/include/curl/curl.h#L120

Attaching the libcurl source code used in the project(note: not building libcurl itself, just consuming the curl.h header):
libcurl.zip

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"invalidResolved as invalid, i.e. not a bugregression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions