-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[SR-14443] [C++] Don't crash on invalid dependent values. #56799
Comments
thomassw66 (JIRA User) this might be another interesting one to look at. It should just be a matter of finding the condition that causes this crash and then bailing on it. |
Comment by Rajagopalan Gangadharan (JIRA) @zoecarver theindigamer (JIRA User) I would like to work on this, is there any details that I might find useful. Please do drop a comment. Thank you! |
Comment by Rajagopalan Gangadharan (JIRA) Upon executing this I was not able to crash the compiler Instead I got a bunch of errors. Does this example needs some tweaking? crash.swift:2:9: error: consecutive statements on a line must be separated by ';'
template <class T>
^
;
crash.swift:2:11: error: expected expression
template <class T>
^
crash.swift:2:18: error: expected '{' in class
template <class T>
^
crash.swift:4:11: error: expected 'func' keyword in static method declaration
static constexpr const S value = T();
^
func
crash.swift:4:21: error: found an unexpected second identifier in function declaration; is there an accidental break?
static constexpr const S value = T();
^
crash.swift:4:21: note: join the identifiers together
static constexpr const S value = T();
~~~~~~~~~~^~~~~
constexprconst
crash.swift:4:21: note: join the identifiers together with camel-case
static constexpr const S value = T();
~~~~~~~~~~^~~~~
constexprConst
crash.swift:4:27: error: expected '(' in argument list of function declaration
static constexpr const S value = T();
^
crash.swift:4:26: error: consecutive declarations on a line must be separated by ';'
static constexpr const S value = T();
^
;
crash.swift:4:27: error: expected declaration
static constexpr const S value = T();
^
crash.swift:3:9: note: in declaration of 'IsSubtypeSame'
struct IsSubtypeSame {
^
crash.swift:7:6: error: consecutive statements on a line must be separated by ';'
using Invalid = IsSubtypeSame<int>;
^
;
crash.swift:2:1: error: cannot find 'template' in scope
template <class T>
^~~~~~~~
crash.swift:4:11: error: expected '{' in body of function declaration
static constexpr const S value = T();
^
crash.swift:7:1: error: cannot find 'using' in scope
using Invalid = IsSubtypeSame<int>;
^~~~~
crash.swift:7:7: error: cannot find 'Invalid' in scope
using Invalid = IsSubtypeSame<int>;
^~~~~~~ |
Hey Rajagopalan (JIRA User)! Happy to have you work on this. Feel free to reach out to me if you get stuck or want some help. > Upon executing this I was not able to crash the compiler Instead I got a bunch of errors. Does this example needs some tweaking? Is it possible that you're putting the C++ code in a Swift file? If so, what you are going to need to do is create a C++ header file and a module map. Then `import Test` the C++ module. You can see an example of this in the `swift/test/Interop/Cxx/namespace` where we have the C++ headers in `namespace/Inputs/<>.h`, the module map in `namespace/Inputs/module.modulemap`, and the Swift files in `namespace/<>.swift`. |
Comment by Rajagopalan Gangadharan (JIRA) @zoecarver Thank you for correcting my stupid mistake 😛. Will do this and let you know how this goes. |
@swift-ci create |
Additional Detail from JIRA
md5: f34665bb62c6ff5d157cb3bd483d8006
Issue Description:
A while theindigamer (JIRA User) found this compiler crasher and I never got around to fixing it or creating a bug for it.
The text was updated successfully, but these errors were encountered: