[OPENMP] Fix for checking of data-sharing attributes for canonical var decls only.

Currently checks for active data-sharing attributes for variables are performed for found var decls. Instead these checks must be performed for canonical decls of these variables to avoid possible troubles with with the differently qualified re-declarations of the same variable, for example:
namespace A { int x; }
namespace B { using A::x; }
Both A::x and B::x actually reference the same object A::x and this fact must be taken into account during data-sharing attributes analysis.

llvm-svn: 235096
diff --git a/clang/test/OpenMP/parallel_copyin_messages.cpp b/clang/test/OpenMP/parallel_copyin_messages.cpp
index 9ae3ffa..4a9fa2a 100644
--- a/clang/test/OpenMP/parallel_copyin_messages.cpp
+++ b/clang/test/OpenMP/parallel_copyin_messages.cpp
@@ -40,6 +40,13 @@
   static T s;
 };
 
+namespace A {
+double x;
+#pragma omp threadprivate(x)
+}
+namespace B {
+using A::x;
+}
 
 S2 k;
 S3 h;
@@ -61,6 +68,7 @@
   #pragma omp parallel copyin(i) // expected-error {{copyin variable must be threadprivate}}
   #pragma omp parallel copyin(m) // expected-error {{'operator=' is a private member of 'S5'}}
   #pragma omp parallel copyin(ST<int>::s) // expected-error {{copyin variable must be threadprivate}}
+  #pragma omp parallel copyin(B::x)
   foo();
 
   return 0;