Steps to reproduce:
1) Create a q&a forum and post a question & a response
2) Login as a student and view the q&a forum
There will then be a notice displayed (in developer mode):
Notice: Undefined variable: forumpostclass in /home/danp/git/moodle/mod/forum/lib.php on line 3158
This is because the forum_print_post function uses $forumpostclass before it is defined later in the function.