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

typedefs gets evaluated a bit to much #378

Closed
ploq opened this issue May 12, 2017 · 8 comments
Closed

typedefs gets evaluated a bit to much #378

ploq opened this issue May 12, 2017 · 8 comments

Comments

@ploq
Copy link
Contributor

ploq commented May 12, 2017

Input:

typedef unsigned int ll;
typedef ll some_array[1];

const some_array& some_func();

Generated output:

const unsigned int ( &)[1] some_func() const {
 	do_something();
}

Expected:

const some_array& some func() {
	do_something();
}
@joakim-brannstrom
Copy link
Owner

joakim-brannstrom commented May 12, 2017

thank you. This will make it easy to fix :)
(famous last words...)

@ploq
Copy link
Contributor Author

ploq commented May 12, 2017

Jinxed it ;)

@joakim-brannstrom
Copy link
Owner

I am unable to reproduce the error in #379

@ploq
Copy link
Contributor Author

ploq commented May 13, 2017

Hmm okay, I will try make some better test code by monday

@ploq
Copy link
Contributor Author

ploq commented May 15, 2017

I am unable to reproduce this in my Mac environment but in Ubuntu (yakkety 16.10, clang 3.8.1) I was able to reproduce...

In one file (foo-bar.hpp):

//include only foo.hpp
namespace Foo { Namespace Bar {
    typedef some_unsigned some;
    typedef some return_val[1];
} }

In another file (foo.hpp):

namespace Foo {
    typedef unsigned int some_unsigned;
}

Header file for function (foo-bar-bla.hpp)

//include only foo-bar.hpp
namespace Foo { namespace Bar { namespace Bla {
    class Blabla {
        public: 
            virtual const Foo::Bar::return_val& Do_something() const = 0;
    };
} } }

Expected and generated output is still the same (return types).

I hope that this is reproducible now...

@joakim-brannstrom
Copy link
Owner

Yes, it is reproducible with clang 3.7. Fixed in #379

@joakim-brannstrom
Copy link
Owner

Thank you for the excellent bug report.

@ploq
Copy link
Contributor Author

ploq commented May 15, 2017

Great work! Can confirm that it works!

@ploq ploq closed this as completed May 15, 2017
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