-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C++: Parse member variables using templates with forward declared types.
Fixes #2867. Co-authored-by: Masatake YAMATO <yamato@redhat.com>
- Loading branch information
1 parent
70677d3
commit 97d2a2c
Showing
4 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
Units/parser-cxx.r/template-member-forward-declaration.d/args.ctags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--sort=no | ||
--kinds-C++=m |
4 changes: 4 additions & 0 deletions
4
Units/parser-cxx.r/template-member-forward-declaration.d/expected.tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
p input.cpp /^ Class *p;$/;" m class:A typeref:typename:Class * file: | ||
a_c_forward input.cpp /^ A<class C> a_c_forward;$/;" m class:B typeref:typename:A<class C> file: | ||
a_s_forward input.cpp /^ A<struct S> a_s_forward;$/;" m class:B typeref:typename:A<struct S> file: | ||
a_u_forward input.cpp /^ A<union U> a_u_forward;$/;" m class:B typeref:typename:A<union U> file: |
16 changes: 16 additions & 0 deletions
16
Units/parser-cxx.r/template-member-forward-declaration.d/input.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
template <class Class> | ||
class A | ||
{ | ||
public: | ||
A() { p = new Class(); } | ||
Class *p; | ||
}; | ||
|
||
class B { | ||
public: | ||
// forward declaration okay because only used as pointer in Template | ||
A<class C> a_c_forward; | ||
A<struct S> a_s_forward; | ||
A<union U> a_u_forward; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters