-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Closed
Copy link
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"clang:modulesC++20 modules and Clang Header ModulesC++20 modules and Clang Header ModulesconceptsC++20 conceptsC++20 concepts
Description
For this code:
// module.map
module "foo" {
export *
header "foo.h"
}
module "bar" {
export *
header "bar.h"
}
// foo.h
template <class T> concept A = true;
// bar.h
template <class T> concept A = false;
// foo.cpp
// clang -std=c++20 -fmodules -fimplicit-modules -fmodule-map-file=module.map foo.cpp
#include "foo.h"
#include "bar.h"
template <class T> void foo() requires A<T> {}
void main() { foo<int>(); }Expected: compiling the code produces an error as concept A is defined differently in two consumed modules, therefore it produces an ODR violation.
Actual: no error about ODR violation. Depending on the chosen concept a call to foo<int>() either succeeds or fails.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"clang:modulesC++20 modules and Clang Header ModulesC++20 modules and Clang Header ModulesconceptsC++20 conceptsC++20 concepts
Type
Projects
Status
No status