A
Alex Vinokur
Hi,
The code below has no problem with GNU g++ 3.3,
but it has a problem with GNU g++ 3.4.
What is reason for that?
--------- [C++] foo.cpp : BEGIN ---------
template <typename T>
struct Boo
{
bool value_;
};
template <typename T>
struct Doo : public Boo<T>
{
Doo () {value_ = false;} // Line#10
};
int main()
{
Doo<int> inst;
return 0;
}
--------- [C++] foo.cpp : END ---`--------
------ Compilation with GNU gcc 3.3 (Cygwin) : BEGIN ------
$ g++ --version
g++ (GCC) 3.3.3 (cygwin special)
[---omitted---]
$ g++ -W -Wall foo.cpp
// No errors/warnings
------ Compilation with GNU gcc 3.3 (Cygwin) : END --------
------ Compilation with GNU gcc 3.4 (DJGPP) : BEGIN ------
$ gpp --version
gpp.exe (GCC) 3.4.1
[---omitted---]
$ gpp -W -Wall foo.cpp
foo.cpp: In constructor `Doo<T>:oo()':
foo.cpp:10: error: `value_' undeclared (first use this function)
foo.cpp:10: error: (Each undeclared identifier is reported only once for each
function it appears in.)
------ Compilation with GNU gcc 3.4 (DJGPP) : END --------
The code below has no problem with GNU g++ 3.3,
but it has a problem with GNU g++ 3.4.
What is reason for that?
--------- [C++] foo.cpp : BEGIN ---------
template <typename T>
struct Boo
{
bool value_;
};
template <typename T>
struct Doo : public Boo<T>
{
Doo () {value_ = false;} // Line#10
};
int main()
{
Doo<int> inst;
return 0;
}
--------- [C++] foo.cpp : END ---`--------
------ Compilation with GNU gcc 3.3 (Cygwin) : BEGIN ------
$ g++ --version
g++ (GCC) 3.3.3 (cygwin special)
[---omitted---]
$ g++ -W -Wall foo.cpp
// No errors/warnings
------ Compilation with GNU gcc 3.3 (Cygwin) : END --------
------ Compilation with GNU gcc 3.4 (DJGPP) : BEGIN ------
$ gpp --version
gpp.exe (GCC) 3.4.1
[---omitted---]
$ gpp -W -Wall foo.cpp
foo.cpp: In constructor `Doo<T>:oo()':
foo.cpp:10: error: `value_' undeclared (first use this function)
foo.cpp:10: error: (Each undeclared identifier is reported only once for each
function it appears in.)
------ Compilation with GNU gcc 3.4 (DJGPP) : END --------