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

Bizarre failure to complete #14

Open
luc-j-bourhis opened this issue Sep 10, 2015 · 3 comments
Open

Bizarre failure to complete #14

luc-j-bourhis opened this issue Sep 10, 2015 · 3 comments

Comments

@luc-j-bourhis
Copy link

I have a file foo.h:

#pragma once

class bar
{
public:
  bar(int x) : x(x) {}
  int val() const { return x; }
private:
  int x;
};

and a file foo.cpp:

#include "foo.h"

double foo() {
  bar xs, *xs1 = xs, xs2 = xs;
  xs.
}

No completion appear after xs. but they do appear after xs1-> and xs2.!!!

This is with company-irony 20150810.239 and irony 20150831.144.

@Sarcasm
Copy link
Owner

Sarcasm commented Sep 11, 2015

It's not the failure that is bizarre but your code :)

  • bar xs is not a valid declaration/definition. bar constructor takes an int

Changing the code to bar xs(1), *xs1 = xs, xs2 = xs; makes the completion work

@luc-j-bourhis
Copy link
Author

On 11 Sep 2015, at 10:11, Guillaume Papin [email protected] wrote:

It's not the failure that is bizarre but your code :)

bar xs is not a valid declaration/definition. bar constructor takes an int

Thanks for your prompt answer. Highly appreciated.

So first how can I display such diagnostics? Then is that a feature or a deficiency? I mean, first this is autocompletion, not a validation tool. And then if validation we want on the top of autocompletion, then silently failing to complete is not the best idea, is it? Some feedback seems in order, doesn’t it? But I may have missed how to enable such feedback.

Best wishes,

Luc

@Sarcasm
Copy link
Owner

Sarcasm commented Sep 11, 2015

So first how can I display such diagnostics?

https://github.com/Sarcasm/flycheck-irony

Then is that a feature or a deficiency?

It's expected behavior. libclang is backed by a real compiler, if you provide semantically incorrect information the completion may not work.

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

2 participants