// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/foo.cppm -I%t -emit-module-interface -o %t/foo.pcm
// RUN: %clang_cc1 -fprebuilt-module-path=%t -std=c++20 %t/use.cpp -I%t/. -fsyntax-only -verify
//--- foo.h
T v;
int v2;
;
int v3;
T v4;
T v5;
inline int a = 43;
T v6;
inline int b = 43;
T v7;
int v8;
consteval int
int v9;
//--- foo_bad.h
T v;
int v2;
;
int v3;
static int a;
consteval int *
T v4;
consteval void *
T v5;
inline int a_ = 43;
T v6;
inline int b_ = 43;
T v7;
int v8;
consteval int
int v9;
//--- foo.cppm
module;
export module foo;
//--- use.cpp
import foo;
// expected-error@foo_bad.h:1 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:1 {{previous default template argument defined in module foo.<global>}}
// expected-error@foo_bad.h:4 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:4 {{previous default template argument defined in module foo.<global>}}
// expected-error@foo_bad.h:10 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:10 {{previous default template argument defined in module foo.<global>}}
// expected-error@foo_bad.h:17 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:13 {{previous default template argument defined in module foo.<global>}}
// expected-error@foo_bad.h:23 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:16 {{previous default template argument defined in module foo.<global>}}
// expected-error@foo_bad.h:27 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:20 {{previous default template argument defined in module foo.<global>}}
// expected-error@foo_bad.h:31 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:24 {{previous default template argument defined in module foo.<global>}}
// expected-error@foo_bad.h:34 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:27 {{previous default template argument defined in module foo.<global>}}
// expected-error@foo_bad.h:40 {{template parameter default argument is inconsistent with previous definition}}
// expected-note@foo.h:33 {{previous default template argument defined in module foo.<global>}}