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

            Bug ID: 23750
           Summary: preprocessor should warn on #include_next with a
                    filename different from the including name
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Suppose:

main.cpp:
#include "foo/bar.h"

foo/bar.h:
#pragma once // or an include guard
#include_next "bar.h"

baz/bar.h:
extern int n;


... and we compile main.cpp with -Ifoo -Ibaz:

  main.cpp includes foo/bar.h
  foo/bar.h includes *itself*

Note that baz/bar.h is never included, and confusion reigns.

We should issue a warning if a file issues a #include_once with a name that
would not have found that same file in the starting search directory for the
#include_next search (that is, if the includer used the wrong name for the
file).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to