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

Nested templates yield token exception #72

Closed
chrizke opened this issue Jul 17, 2015 · 3 comments
Closed

Nested templates yield token exception #72

chrizke opened this issue Jul 17, 2015 · 3 comments

Comments

@chrizke
Copy link

chrizke commented Jul 17, 2015

From C++11 on, nested templates do not require a whitespace between closing '>' anymore.

Before C++11:

std::vector<std::vector<double> >

C++11:

std::vector<std::vector<double>>

The second version yields a token exception.

@myint
Copy link
Owner

myint commented Jul 17, 2015

Can you provide the error message? Also, what version of cppclean are you using?

Thanks

@chrizke
Copy link
Author

chrizke commented Jul 17, 2015

I'm using 0.2.6.

The error message is

Got exception in D:\cppclean\MyClass.h @ Token('std', 164, 167) []
Got exception in D:\cppclean\MyClass.h @ Token('class', 77, 82) []
D:\cppclean\MyClass.h: parsing error [Token('std', 164, 167), Token('::', 167, 169), Token('vector', 169, 175), Token('<', 175, 176), Token('std', 176, 179), Token('::', 179, 181), Token('pair', 181, 185), Token('<', 185, 186), Token('double', 186, 192), Token(',', 192, 193), Token('OtherClass', 194, 204), Token('>>', 204, 206)]

and MyClass.h is

#pragma once

#include "OtherClass.h"

#include <vector>
#include <utility>

class CMyClass
{
public:
  CMyClass();

private:
  COtherClass & mOtherClass;
  std::vector<std::pair<double, OtherClass>> myVec;
};

@r-e-d
Copy link
Collaborator

r-e-d commented Jul 19, 2015

This is fixed by my latest commit.

Thanks for the report.

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