clang-omp/clang — pull request #40 by viroulep (2014-07-23 15:17:47+00:00)
Title: Fix DSA for function parameters.

Function parameters are erroneously detected as shared.

This test comes from the gcc testsuite (omp-single-3), and clang-omp (a65de2d1) complains that `a` and `b` are not private while they actually are.
The error message is the following : `error: copyprivate variable must be threadprivate or private in the enclosing context`

extern void abort (void);

void
single (int a, int b)
{
#pragma omp single copyprivate(a) copyprivate(b)
{
a = b = 5;
}

if (a != b)
abort ();
}

int main()
{
#pragma omp parallel
single (1, 2);

return 0;
}

This happens because `isFunctionOrMethodVarDecl` only check for `Decl::Var` and not for `Decl::ParmVar`.
According to the documentation it's the expected behaviour, so I guess the additional check belongs in `SemaOpenMP`.