1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
commit cb13b7153452060d919603d31ad4db94b3056f35
Author: Adriaan de Groot <groot@kde.org>
Date: Sat Oct 12 20:41:30 2019 +0200
Private inheritance hides base-class names.
Summary:
Kwave fails to compile with clang 9.0, with this kind of error message:
===
In file included from /wrkdirs/usr/ports/audio/kwave/work/kwave-19.08.1/libkwave/undo/UndoDeleteAction.cpp:24:
/wrkdirs/usr/ports/audio/kwave/work/kwave-19.08.1/libkwave/MultiTrackReader.h:61:24: error: 'QList' is a private member of 'QList<Kwave::SampleReader *>'
const QList<unsigned int> &track_list,
^
/wrkdirs/usr/ports/audio/kwave/work/kwave-19.08.1/libkwave/MultiTrackSource.h:41:36: note: constrained by private inheritance here
private QList<SOURCE *>
^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/qt5/QtCore/qlist.h:127:7: note: member is declared here
class QList
^
1 error generated.
===
This can be demonstrated much more shortly with this code:
===
class foo {};
class bar : private foo {};
class baz : public bar
{
public:
foo m_foo;
};
===
Within baz, foo is looked up in bar, and then (because it's *private*
inheritance) afterwards access-control kicks in and disallows its use.
By fully-qualifying foo (or, in Kwave's case, QList) the name-lookup
happens differently, and the public (global) name is found.
There is also a description of the problem on StackOverflow,
https://stackoverflow.com/questions/41595208/accessing-the-name-of-a-private-inherited-class-from-a-subclass
Test Plan:
- still compiles
- packaging on FreeBSD-CURRENT, with clang 9, works again
Differential Revision: https://reviews.freebsd.org/D22002
diff --git libkwave/MultiTrackReader.cpp libkwave/MultiTrackReader.cpp
index aedce6bb..0053d980 100644
--- libkwave/MultiTrackReader.cpp
+++ libkwave/MultiTrackReader.cpp
@@ -32,7 +32,7 @@ Kwave::MultiTrackReader::MultiTrackReader()
//***************************************************************************
Kwave::MultiTrackReader::MultiTrackReader(Kwave::ReaderMode mode,
Kwave::SignalManager &signal_manager,
- const QList<unsigned int> &track_list,
+ const ::QList<unsigned int> &track_list,
sample_index_t first,
sample_index_t last)
:Kwave::MultiTrackSource<Kwave::SampleReader, false>(0),
diff --git libkwave/MultiTrackReader.h libkwave/MultiTrackReader.h
index 5de02956..1d08c296 100644
--- libkwave/MultiTrackReader.h
+++ libkwave/MultiTrackReader.h
@@ -58,7 +58,7 @@ namespace Kwave
*/
MultiTrackReader(Kwave::ReaderMode mode,
Kwave::SignalManager &signal_manager,
- const QList<unsigned int> &track_list,
+ const ::QList<unsigned int> &track_list,
sample_index_t first, sample_index_t last);
/** Destructor */
diff --git libkwave/MultiTrackWriter.cpp libkwave/MultiTrackWriter.cpp
index e875f445..6c6b662a 100644
--- libkwave/MultiTrackWriter.cpp
+++ libkwave/MultiTrackWriter.cpp
@@ -35,7 +35,7 @@ Kwave::MultiTrackWriter::MultiTrackWriter()
//***************************************************************************
Kwave::MultiTrackWriter::MultiTrackWriter(Kwave::SignalManager &signal_manager,
- const QList<unsigned int> &track_list,
+ const ::QList<unsigned int> &track_list,
Kwave::InsertMode mode,
sample_index_t left,
sample_index_t right)
@@ -52,7 +52,7 @@ Kwave::MultiTrackWriter::MultiTrackWriter(Kwave::SignalManager &signal_manager,
Kwave::InsertMode mode)
:Kwave::MultiWriter()
{
- QList<unsigned int> track_list = signal_manager.selectedTracks();
+ ::QList<unsigned int> track_list = signal_manager.selectedTracks();
sample_index_t left = 0;
sample_index_t right = 0;
@@ -82,7 +82,7 @@ Kwave::MultiTrackWriter::~MultiTrackWriter()
//***************************************************************************
bool Kwave::MultiTrackWriter::init(Kwave::SignalManager &signal_manager,
- const QList<unsigned int> &track_list,
+ const ::QList<unsigned int> &track_list,
Kwave::InsertMode mode,
sample_index_t left,
sample_index_t right)
diff --git libkwave/MultiTrackWriter.h libkwave/MultiTrackWriter.h
index df3c3086..d809680e 100644
--- libkwave/MultiTrackWriter.h
+++ libkwave/MultiTrackWriter.h
@@ -55,7 +55,7 @@ namespace Kwave
* @param right index of the last sample
*/
MultiTrackWriter(Kwave::SignalManager &signal_manager,
- const QList<unsigned int> &track_list,
+ const ::QList<unsigned int> &track_list,
Kwave::InsertMode mode,
sample_index_t left, sample_index_t right);
@@ -86,7 +86,7 @@ namespace Kwave
* @internal
*/
bool init(Kwave::SignalManager &signal_manager,
- const QList<unsigned int> &track_list,
+ const ::QList<unsigned int> &track_list,
Kwave::InsertMode mode,
sample_index_t left, sample_index_t right);
|