<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56327>56327</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Drivers] [Modules] Inconsistent behavior between clang and clang_cc1
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:driver,
            clang:modules
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ChuanqiXu9
      </td>
    </tr>
</table>

<pre>
    For the following example:

```C++
//--- foo.h
template <typename T, typename U = int>
class Templ;

template <typename T, typename U>
class Templ {};

template <typename T>
Templ(T t) -> Templ<T, int>;

//--- A.cppm
module;
#include "foo.h"
export module A;

//--- Use.cppm
module;
#include "foo.h"
export module X;
import A;
```

It would crash if I run:

```
%clang -std=c++20 A.cppm -o A.pcm --precompile
%clang -std=c++20 -fprebuilt-module-path=. -I. Use.cppm 
```

But once I use %clang_cc1, it is fine:

```
%clang_cc1 -std=c++20 A.cppm -o .A.pcm -emit-module-interface
%clang_cc1 -std=c++20 -fprebuilt-module-path=. -I. ./Use.cppm
```

Although I haven't located the problem, I guess it should be a bug.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVEtv4yAQ_jX4MrLl4JLUBx_y2Eo57K2VelthjG1WGLwG-vj3OzZJNpX6OqyEEmA8M9_3zQy1bV6rOzuB7yW0Vmv7rEwH8oUPo5ak2JL8QPLz7zqPa0_obl7xlt7hStMU_W3Wx0sv0Z97CaTY-9dRGj5IuCd0D5fTA9oOoIwnxY_oJDR3Du5nV1LsrjN_J9x7YYBsdmRz-F60s38EQG_vwRNaQoqGM6j9kvOE-W3QfzJsMzGOQ7wdbBNmHS9aFcoIHRrMTWnUi9Joky-jnTxED9h-GP7Byf-R4PHio4bl_irjuc7XAI4enm3QDYiJux5UC0eYgvmoRc5wGFYDGyp1vsFyi9g4ND-JBKnF3Shwk46TFHYYFbL5wjdt8ds6KO3TSCYdue_xkwzSY3YRCD5hswserBESSQQ3axVz_RJitVTYg3LQKvPhCLzFOPt9xjE7kZSDumDGLpJTy4X8TqgvKGfYG2_74l3WW-17G7oeWff8SRpCNx60FTgLzfICjJOttRxmCY7QBYlzhFK4fil8LYFDHbosBkuaqmjKouSJV17LirDdYVJPcnKEHQBPPxegy-lohDVOOS-NxziYXOGbU0v_LKWBWGZuGrgokIRJV733o5sLsPR-p3wf6gx7BA9aP53_sHHsbylwVu-Uc4gZN2xd0E3SV7di3XDG2GbN87bklAvG21YwsSoLLjZ1onkttZux45gs2TFfs9CY5wZ1uLofToTQwA6JqmhOab7JVzkrSkazMl8xRkW9am8EWxU5ucnlwJXOZpSZnbpkqhbAqKFDo0Y93D8jPlqqM3IRco7PAxZrqvZ94OaPegxlstCrFm5_Aeo4rck">