-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Bugzilla Link | 28851 |
Version | unspecified |
OS | All |
Reporter | LLVM Bugzilla Contributor |
CC | @seanm |
Extended Description
Imagine the following scenario:
// foo.cpp
#include "foo.h"
// foo.h
#ifndef FOO_H
#define FOO_H
#include "bar.h"
#endif
// bar.h
#ifndef FOO_H
#define FOO_H
#endif
This happens occasionally as a result of copy-pasting one header file to another header file to get the basic layout (header file premable, include guards, namespace layout, etc) in place and then fixing up. But occasionally one forgets to fix the header guard, leading to mysterious compiler errors.
It would be nice if this warned, by keeping for each translation unit a mapping of hashed include guard to include file name, and if an entry is found that exists in the hash table under a different filename, generating a warning.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"