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

Fix NULL check #1656

Merged
merged 2 commits into from
Jan 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Units/parser-cxx.r/enum-in-a-struct--with-q-extra.d/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
S::T::E::alpha and S::T::E::beta are not included intentionally
Taken from the comments of cxx_tag.c::

// If the scope kind is enumeration then we need to remove the
// last scope part. This is what old ctags did.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--extra=+q
12 changes: 12 additions & 0 deletions Units/parser-cxx.r/enum-in-a-struct--with-q-extra.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
S input.cc /^namespace S {$/;" n file:
T input.cc /^ struct T {$/;" s namespace:S file:
S::T input.cc /^ struct T {$/;" s namespace:S file:
E input.cc /^ enum E {$/;" g struct:S::T file:
S::T::E input.cc /^ enum E {$/;" g struct:S::T file:
alpha input.cc /^ alpha, beta,$/;" e enum:S::T::E file:
S::T::alpha input.cc /^ alpha, beta,$/;" e enum:S::T::E file:
beta input.cc /^ alpha, beta,$/;" e enum:S::T::E file:
S::T::beta input.cc /^ alpha, beta,$/;" e enum:S::T::E file:
elt input.cc /^ } elt;$/;" m struct:S::T typeref:enum:S::T::E file:
S::T::elt input.cc /^ } elt;$/;" m struct:S::T typeref:enum:S::T::E file:
s input.cc /^struct S::T s = { .elt = S::T::E::alpha };$/;" v typeref:struct:S::T
9 changes: 9 additions & 0 deletions Units/parser-cxx.r/enum-in-a-struct--with-q-extra.d/input.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace S {
struct T {
enum E {
alpha, beta,
} elt;
};
}

struct S::T s = { .elt = S::T::E::alpha };
2 changes: 1 addition & 1 deletion parsers/cxx/cxx_token_chain.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void cxxTokenChainJoinRangeInString(
while(t && (t != to))
{
t = t->pNext;
if(t)
if(!t)
return;

if(szSeparator)
Expand Down