modules: #pragma once
must appear before #ifdef
when using -fmodules
#38532
Labels
#pragma once
must appear before #ifdef
when using -fmodules
#38532
Extended Description
When compiling with
-fmodules
(but not necessarily actually building modules),#pragma once
guards don't work when appearing after a#ifdef ...
guard. Example failing test: https://reviews.llvm.org/differential/diff/168367/.I couldn't find any supporting documentation saying that
#pragma once
must come first, but assuming this is true, then this probably isn't a bug (but maybe should then be a warning?).The text was updated successfully, but these errors were encountered: