mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Bug 401142 - Error involving variadic non-type template parameters
Change-Id: I7735649c59354431a91980142055e4b86a82e6f6 Reviewed-on: https://git.eclipse.org/r/10467 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
ee08bee24b
commit
24ba7ff688
2 changed files with 21 additions and 0 deletions
|
@ -7292,5 +7292,24 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
public void testNPE_401140() throws Exception {
|
||||
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
|
||||
helper.assertProblem("bind(s, 0, foo)", "bind");
|
||||
}
|
||||
|
||||
// template <bool... Args>
|
||||
// struct ice_or;
|
||||
// template <bool First>
|
||||
// struct ice_or<First> {
|
||||
// static const bool value = First;
|
||||
// };
|
||||
// template <bool>
|
||||
// struct S {};
|
||||
// template <>
|
||||
// struct S<false> {
|
||||
// typedef int type;
|
||||
// };
|
||||
// int main() {
|
||||
// S<ice_or<false>::value>::type t;
|
||||
// }
|
||||
public void testVariadicNonTypeTemplateParameter_401142() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2464,6 +2464,8 @@ public class CPPTemplates {
|
|||
} else {
|
||||
if (arg.isTypeValue())
|
||||
return false;
|
||||
if (par.isParameterPack() != arg.isPackExpansion())
|
||||
return false;
|
||||
int parpos= Value.isTemplateParameter(arg.getNonTypeValue());
|
||||
if (parpos != par.getParameterID())
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue