[llvm-bugs] [Bug 39184] New: modules: `#pragma once` must appear before `#ifdef` when using `-fmodules`

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 4 13:46:40 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=39184

            Bug ID: 39184
           Summary: modules: `#pragma once` must appear before `#ifdef`
                    when using `-fmodules`
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andrewjcg at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

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?).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181004/7305888b/attachment.html>


More information about the llvm-bugs mailing list