urnathan added inline comments.
================ Comment at: clang/test/CodeGenCXX/static-variable-in-module.cpp:2-8 +// RUN: mkdir %t +// RUN: echo "struct S { S(); };" >> %t/foo.h +// RUN: echo "static S s = S();" >> %t/foo.h +// RUN: %clang -std=c++20 -I%t %s -S -emit-llvm -o - | FileCheck %s +module; +#include "foo.h" +export module m; ---------------- rather than generate a foo.h file, why not (ab)use the preprocessor with internal line directives? ``` module; # 3 __FILE__ 1 // use the next physical line number here (and below) struct S { S(); }; static S s = S(); # 6 "" 2 export module m; ... ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119409/new/ https://reviews.llvm.org/D119409 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits