• Forum
  • Lounge
  • Visual C++ 2010 Error Checking Not Detec

 
 
Visual C++ 2010 Error Checking Not Detecting Errors

closed account (zb0S216C)
It's strange. My Visual C++ doesn't seem to be picking up any errors in my code. To show you how strange it is, here's a block of demonstration code that replicates the ( potential ) Visual C++ error checking system bug:

1
2
3
4
5
6
template < typename __TYPENAME__ >
SampleClass < __TYPENAME__ >::SampleClass( void )
{
    Buffer_data.a = 0;  // 'a' is a member of 'Buffer_data'.
    Buffer_data.b = 0;  // 'b' doesn't exist in 'Buffer_data'.
}

In this demonstration code, Buffer_data.b isn't marked as an error, even though it is. Why won't Visual C++ pick this up?

Demonstration code notes:
1) Buffer_data is an instance of BufferData.
2) BufferData is a sub-struct of SampleClass.
Last edited on
Are you saying it compiles? Or just that intellisense isn't noticing it?
closed account (zb0S216C)
I compiles( as a static library ) but, Intellisense isn't detecting it. No errors, no warnings.
Last edited on
If find that intellisense can be a little temperamental. Maybe it will be gone later?
It's not evaluated until you use the template, it doesn't make sense to. You can't know if the construct it correct or not until the compiler can see the parameterised type.
Topic archived. No new replies allowed.