llvm-project/clang/test/Modules/cxx20-disable.cpp
Jan Svoboda 0556138624 [clang][cli] Expose -fno-cxx-modules in cc1
For some use-cases, it might be useful to be able to turn off modules for C++ in `-cc1`. (The feature is implied by `-std=C++20`.)

This patch exposes the `-fno-cxx-modules` option in `-cc1`.

Reviewed By: arphaman

Differential Revision: https://reviews.llvm.org/D106864
2021-08-04 13:46:40 +02:00

11 lines
475 B
C++

// RUN: rm -rf %t && mkdir %t
// RUN: %clang_cc1 -x objective-c++ -std=c++20 -I %t %s -verify=enabled
// RUN: %clang_cc1 -x objective-c++ -std=c++20 -fno-cxx-modules -I %t %s -verify=disabled
// enabled-no-diagnostics
// The spelling of these errors is misleading.
// The important thing is Clang rejected C++20 modules syntax.
export module Foo; // disabled-error{{expected template}}
// disabled-error@-1{{unknown type name 'module'}}