[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

Luke Lau via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 3 23:31:55 PDT 2024


lukel97 wrote:

Hi, I'm no longer able to compile SPEC CPU 2017 after this due to an error in 510.parest_r:

```
/cpu2017/benchspec/CPU/510.parest_r/src/source/fe/fe_tools.cc:2020:15: error: partial ordering for explicit instantiation of 'back_interpolate' is ambiguous
 2020 | void FETools::back_interpolate<3>
      |               ^
/cpu2017/benchspec/CPU/510.parest_r/src/source/fe/fe_tools.cc:1167:10: note: explicit instantiation candidate function 'dealii::FETools::back_interpolate<3, dealii::Vector<double>, dealii::Vector<double>, 3>' template here [with dim = 3, InVector = dealii::Vector<double>, OutVector = dealii::Vector<double>, spacedim = 3]
 1167 | FETools::back_interpolate(const DoFHandler<dim,spacedim> &dof1,
      |          ^
/cpu2017/benchspec/CPU/510.parest_r/src/source/fe/fe_tools.cc:1219:10: note: explicit instantiation candidate function 'dealii::FETools::back_interpolate<3, dealii::DoFHandler, dealii::Vector<double>, dealii::Vector<double>, 3>' template here [with dim = 3, DH = dealii::DoFHandler, InVector = dealii::Vector<double>, OutVector = dealii::Vector<double>, spacedim = 3]
 1219 | FETools::back_interpolate(const DH<dim> &dof1,
      |          ^
```

I think it's based off this https://github.com/dealii/dealii/blob/master/source/fe/fe_tools.cc, but unfortunately what SPEC is using seems to be quite out of date. I can try plugging this into creduce and see if it gives a reproducer. 

I'm not a C++ expert by any means so maybe this error is correct. Is there a flag that could be used to workaround this?

https://github.com/llvm/llvm-project/pull/100692


More information about the cfe-commits mailing list