Skip to content

Commit

Permalink
Units,C++: add a case for testing the change proposed in #1656
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake authored and siiky committed Jan 11, 2018
1 parent 6c68649 commit a877beb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
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 };

0 comments on commit a877beb

Please sign in to comment.