kkwli0 marked an inline comment as done. kkwli0 added inline comments.
================ Comment at: lib/Sema/SemaOpenMP.cpp:12671 +void Sema::checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D, + const DeclarationNameInfo *Id) { if (!D || D->isInvalidDecl()) ---------------- ABataev wrote: > kkwli0 wrote: > > ABataev wrote: > > > You can get `DeclarationNameInfo` from the `FunctionDecl`: > > > ``` > > > FD->getNameInfo() > > > ``` > > This FD->getNameInfo() will only give the name info from the function > > definition. What we need here is the name info for 'foo' that appears on > > the pragma in order to give us > > > > ``` > > d2.c:2:33: error: function name is not allowed in 'link' clause > > #pragma omp declare target link(foo) > > ^ > > ``` > Then just pass `SourceLocation` Sure. https://reviews.llvm.org/D40968 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits