[OpenMP] Declare variants for templates need to match # template args
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 28 Oct 2021 00:39:28 +0000 (19:39 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 28 Oct 2021 02:04:32 +0000 (21:04 -0500)
commit6cf6fa6ef1c28de0d553a38defa719342774f104
treedf59e48c22acfe9451269192b65acd4395aa009e
parentacf3093117e354c7cdf097600cd406a16720804d
[OpenMP] Declare variants for templates need to match # template args

A declare variant template is only compatible with a base when the
number of template arguments is equal, otherwise our instantiations will
produce nonsensical results.

Exposes as part of D109344.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D109770
clang/lib/Sema/SemaOpenMP.cpp
clang/test/AST/ast-dump-openmp-begin-declare-variant_template_4.cpp [new file with mode: 0644]