Author Topic: Not sure if this is a bug in the parser or not  (Read 2658 times)

OverlordManny

  • Guest
Not sure if this is a bug in the parser or not
« on: November 01, 2017, 07:58:37 am »
Using CodeBlocks 16.01 with c++11 flags I found that when making an alias of a nested template that the following code block gets placed in namespace std.

For example:

Code
Using Foo = std::vector<std::pair<int, int>>;

struct Bar
{
    public:
        Bar(const int& i) : m_int(i)
        {
              // code here
        }

        // members here
        int m_int;
};

The parser puts the struct named Bar into the std namespace. The following blocks however seem to parse correctly.

Is this irregular behavior? I've worked around it by aliasing the inner template first then used that alias in the outer template.
« Last Edit: November 01, 2017, 08:27:06 am by OverlordManny »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Not sure if this is a bug in the parser or not
« Reply #1 on: November 01, 2017, 09:07:45 am »
Probably it is normal. Our parser is not c++>=11 ready. It doesn't understand all/most new constructs, so it is easy for it to get confused.

If you can provide a minimal standalone sample without includes it might be helpful. Open a ticket on sf.net, so it won't get lost.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]