She is supposed to be overconfident, which will erase her anxiety.
It is correct to use a complete clause as a noun, which can have a relative clause?
And is the sentence correct, regardless of the question? And please explain it.
She is supposed to be overconfident, which will erase her anxiety.
It is correct to use a complete clause as a noun, which can have a relative clause?
And is the sentence correct, regardless of the question? And please explain it.
Certainly a whole clause can be the subject of "which":
He's unpredictable, which means he's a brilliant chess player.
This is enabled both by the fact that whole clauses can sometimes function as nouns and the fact that "which" is very forgiving and can pick out pretty much anything that comes before it as an antecedent, at least in casual conversation. (Which is a common concession.)
Your sentence is grammatically fine. However, I wouldn't say that "which" here refers to the whole previous clause, because the thing that "will erase her anxiety" is being overconfident — not the fact that she's supposed to be overconfident.
She's supposed to be overconfident. Being overconfident will erase her anxiety.
Notice that this exact phrase doesn't even occur in the first half of the sentence. The takeaway is that you shouldn't be surprised to find "which" referring to almost anything, even something implicit.
One reference is on Wikipedia's "antecedent" article (unfortunately the individual section is unsourced):
h. Susan lies all the time, which everybody knows about. - Entire clause as antecedent
i. Our politicians have been pandering again. This demotivates the voters. - Entire sentence as antecedent