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

Declarations referenced in a dependent template argument may get removed #8

Open
AlCash07 opened this issue Jul 1, 2017 · 9 comments

Comments

@AlCash07
Copy link
Contributor

AlCash07 commented Jul 1, 2017

Example: http://ideone.com/QaLeKP

If I rewrite the function in the following way, everything works:
template <class Y> void f(Y& y) { typename Y::value_type value = 42; y.value = value; }

@slycelote slycelote changed the title Type alias is removed when used as a template parameter default type Declarations referenced in a dependent template argument may get removed Jul 2, 2017
@AlCash07
Copy link
Contributor Author

AlCash07 commented Sep 1, 2018

This issue is actually very important for template metaprogramming. The following example fails on multiple levels: https://ideone.com/8UCOkK

@jcg9129
Copy link

jcg9129 commented Oct 14, 2024

Any update on this?

@slycelote
Copy link
Owner

No, but I'll try to look into it and see if things changed with recent clang.
Do you have your own example? Things might be subtly different, so it's good to have as many test cases as possible.

slycelote added a commit that referenced this issue Oct 25, 2024
@slycelote
Copy link
Owner

ok, at least simple cases should work now.
Let me know if there's some specific scenario that is still failing for you.

@jcg9129
Copy link

jcg9129 commented Nov 13, 2024

Hi, @slycelote. This case fails https://pastebin.com/ipEMpeLC.

slycelote added a commit that referenced this issue Nov 19, 2024
@slycelote
Copy link
Owner

That's an unrelated problem; support for concepts is new and I expect you'll find more issues. I fixed this one.

slycelote added a commit that referenced this issue Nov 25, 2024
@jcg9129
Copy link

jcg9129 commented Dec 24, 2024

Hi, @slycelote. Those three still fail: https://pastebin.com/W2yDdMFJ, https://pastebin.com/eFiqanZg and https://pastebin.com/ir6ACLAC. Only the last two use concepts.

@slycelote
Copy link
Owner

The first one (without requires clause) works for me. Can you confirm you're synced to the latest commit? Also, what clang version are you using?

@jcg9129
Copy link

jcg9129 commented Dec 24, 2024

The first one (without requires clause) works for me. Can you confirm you're synced to the latest commit? Also, what clang version are you using?

You are right. I was building with an old version. The first code works for me now. I am using this Docker file to build the app https://pastebin.com/Mn3K8ERg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants