Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-format type casts in dictionaries on wrong line #23021

Closed
llvmbot opened this issue Feb 20, 2015 · 2 comments
Closed

clang-format type casts in dictionaries on wrong line #23021

llvmbot opened this issue Feb 20, 2015 · 2 comments
Labels
bugzilla Issues migrated from bugzilla clang-tools-extra

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 20, 2015

Bugzilla Link 22647
Resolution FIXED
Resolved on Oct 11, 2015 22:19
Version unspecified
OS All
Attachments The clang-format used to reproduce this issue
Reporter LLVM Bugzilla Contributor

Extended Description

When defining a dictionary with keys that have a typecast the formatting is off, concatenating the typecast to the previous line instead of having it prefix the key.

What I would like to see:
NSDictionary *passwordQuery = @{
(__bridge id)kSecClass: (__bridge id)kSecClassGenericPassword,
(__bridge id)kSecReturnData: (__bridge id)kCFBooleanTrue,
(__bridge id)kSecReturnAttributes: (__bridge id)kCFBooleanTrue,
};

Actual formatting:
NSDictionary *passwordQuery = @{
(__bridge id)kSecClass: (__bridge id)kSecClassGenericPassword, (__bridge id)
kSecReturnData: (__bridge id)kCFBooleanTrue, (__bridge id)
kSecReturnAttributes: (__bridge id)kCFBooleanTrue,
};

See attached the format file used.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 7, 2015

Also seeing this bug. Working around it for now by enclosing the mis-formatted expression in parens.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 12, 2015

Fixed by r250010.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-tools-extra
Projects
None yet
Development

No branches or pull requests

1 participant