How can I make vC ++ and g ++ behave the same with respect to typename for dependent qualified types?

Is there a switch that I can provide for cl.exe that will include a warning or an error if typename missing from a qualified dependent type?

I work in an environment where developers tend to work on the same platform, either on Windows or Linux, and the code is ultimately generated on both platforms at night. We run into a problem when people forget to use typename for qualified dependent types on Windows, where Visual C ++ 2008 will automatically add the missing typename , if possible. When they check the code in this way, it breaks the assembly on Linux, where g++ requires typename . It would be advisable to configure the Makefile so that we can expect the same typename behavior for Windows and Linux to reduce the likelihood of a build failure. I prefer g++ behavior, but anything that would help the two platforms behave the same would be very helpful.

See also Why do I need to use typedame typedef in g ++, but not VS?

+6
c ++ visual-c ++ templates g ++
source share
2 answers

There are no such checks in Visual Studio 2005 or 2008. The reason for this is because the internal components of the compiler (how templates are processed) differ between VS and GCC, and VS does much less processing until templates are created. Almost everything seems to be explained in the question you linked.

I think you can consider this a Visual Studio error.

I'm not sure what the status of this is in VS 2010 - I have not tested it yet.

0
source share

My workstation solved all problems of this kind by introducing a continuous integration server. In our case, we were quite satisfied with TeamCity . It is very customizable, and with some bash scripts, I'm sure you can well imagine gcc errors in TeamCity. I configured our server so that I get Doxygen errors, and we reduced the number of errors from the initial 11000 to 0, within a few months.

Good luck

+5
source share

All Articles