From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Description of problem: The following code results with compiler error report "var was not declared in this scope": ------------------------------------------- template <class T> void doit( T var ) { struct st { int i; char s[sizeof(var)]; } zz; } int main() { doit(3); } Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Copy program from description 2. compile using g++ 3. Actual Results: bug1.cc: In instantiation of `doit (T) [with T = int]::st': bug1.cc:4: instantiated from `doit (T) [with T = int]' bug1.cc:9: instantiated from here bug1.cc:4: `var' was not declared in this scope Expected Results: Variable var is a "doit" function parameter. Additional info:
verified stil true in g++ 3.2
Fixed during the 3.4 release cycle. Fails in 3.4 20030425, fixed in 3.4.3 20041001.