I'm not sure how to write a test for this though. The issue is a
missing LValueToRValue cast. Code gen is already tolerant of the
missing cast so isn't affected by the fix. I'm not very familiar with
the infrastructure available in the Clang test suite.
If you expect the AST to stay stable, you can pass the output of -ast-dump to FileCheck and use FileCheck to confirm that the cast is there. test/SemaCXX/template-implicit-vars.cpp is an example which uses this technique. In addition, the documentation for FileCheck is at http://llvm.org/docs/CommandGuide/FileCheck.html
Since LValueToRValue casts are common, it would be better to use a CHECK followed by several CHECK-NEXT’s since CHECK-NEXT does not allow extra lines between the previous check line.