summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/DiagnosticLexKinds.td
Commit message (Collapse)AuthorAgeFilesLines
* [backported/clang-9][Preamble] Stop circular inclusion of main file when ↵release_80-basedNikolai Kosjar2019-05-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | building preamble -------------------------------------------------------------------------- https://reviews.llvm.org/D53866 -------------------------------------------------------------------------- If a header file was processed for the second time, we could end up with a wrong conditional stack and skipped ranges: In the particular example, if the header guard is evaluated the second time and it is decided to skip the conditional block, the corresponding "#endif" is never seen since the preamble does not include it and we end up in the Tok.is(tok::eof) case with a wrong conditional stack. Detect the circular inclusion, emit a diagnostic and stop processing the inclusion. Fixes: QTCREATORBUG-20883 Change-Id: I02644ddb507db4033dd5c69920c8e10500f0121c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* PTH-- Remove feature entirely-Erich Keane2018-12-041-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging a boost build with a modified version of Clang, I discovered that the PTH implementation stores TokenKind in 8 bits. However, we currently have 368 TokenKinds. The result is that the value gets truncated and the wrong token gets picked up when including PTH files. It seems that this will go wrong every time someone uses a token that uses the 9th bit. Upon asking on IRC, it was brought up that this was a highly experimental features that was considered a failure. I discovered via googling that BoostBuild (mostly Boost.Math) is the only user of this feature, using the CC1 flag directly. I believe that this can be transferred over to normal PCH with minimal effort: https://github.com/boostorg/build/issues/367 Based on advice on IRC and research showing that this is a nearly completely unused feature, this patch removes it entirely. Note: I considered leaving the build-flags in place and making them emit an error/warning, however since I've basically identified and warned the only user, it seemed better to just remove them. Differential Revision: https://reviews.llvm.org/D54547 Change-Id: If32744275ef1f585357bd6c1c813d96973c4d8d9 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348266 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose likely typos in #include directives.Richard Smith2018-09-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When someone writes #include "<some_file>" or #include " some_file " the compiler returns "file not fuond..." with fonts and quotes that may make it hard to see there are excess quotes or surprising bytes in the filename. Assuming that files are usually logically named and start and end with an alphanumeric character, we can check for the file's existence by stripping the non-alphanumeric leading or trailing characters. If the file is found, emit a non-fatal error with a FixItHint. Patch by Christy Lee! Reviewers: aaron.ballman, erikjv, rsmith Reviewed By: rsmith Subscribers: lebedev.ri, xbolva00, sammccall, modocache, erikjv, aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D51333 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342177 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-cl, PCH] Support for /Yc and /Yu without filename and #pragma hdrstopMike Rice2018-09-111-0/+7
| | | | | | | | | | | | | | | With clang-cl, when the user specifies /Yc or /Yu without a filename the compiler uses a #pragma hdrstop in the main source file to determine the end of the PCH. If a header is specified with /Yc or /Yu #pragma hdrstop has no effect. The optional #pragma hdrstop filename argument is not yet supported. Differential Revision: https://reviews.llvm.org/D51391 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341963 91177308-0d34-0410-b5e6-96231b3b80d8
* PR38870: Add warning for zero-width unicode characters appearing inRichard Smith2018-09-071-0/+3
| | | | | | identifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341700 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaceFangrui Song2018-07-301-6/+6
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-cl, PCH] Implement support for MS-style PCH through headersErich Keane2018-07-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | Implement support for MS-style PCH through headers. This enables support for /Yc and /Yu where the through header is either on the command line or included in the source. It replaces the current support the requires the header also be specified with /FI. This change adds a -cc1 option -pch-through-header that is used to either start or stop compilation during PCH create or use. When creating a PCH, the compilation ends after compilation of the through header. When using a PCH, tokens are skipped until after the through header is seen. Patch By: mikerice Differential Revision: https://reviews.llvm.org/D46652 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336379 91177308-0d34-0410-b5e6-96231b3b80d8
* Warning for framework include violation from Headers to PrivateHeadersBruno Cardoso Lopes2018-06-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Framework vendors usually layout their framework headers in the following way: Foo.framework/Headers -> "public" headers Foo.framework/PrivateHeader -> "private" headers Since both headers in both directories can be found with #import <Foo/some-header.h>, it's easy to make mistakes and include headers in Foo.framework/PrivateHeader from headers in Foo.framework/Headers, which usually configures a layering violation on Darwin ecosystems. One of the problem this causes is dep cycles when modules are used, since it's very common for "private" modules to include from the "public" ones; adding an edge the other way around will trigger cycles. Add a warning to catch those cases such that: ./A.framework/Headers/A.h:1:10: warning: public framework header includes private framework header 'A/APriv.h' #include <A/APriv.h> ^ rdar://problem/38712182 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335542 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply: Warning for framework headers using double quote includesBruno Cardoso Lopes2018-06-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce -Wquoted-include-in-framework-header, which should fire a warning whenever a quote include appears in a framework header and suggest a fix-it. For instance, for header A.h added in the tests, this is how the warning looks like: ./A.framework/Headers/A.h:2:10: warning: double-quoted include "A0.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header] #include "A0.h" ^~~~~~ <A/A0.h> ./A.framework/Headers/A.h:3:10: warning: double-quoted include "B.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header] #include "B.h" ^~~~~ <B.h> This helps users to prevent frameworks from using local headers when in fact they should be targetting system level ones. The warning is off by default. Differential Revision: https://reviews.llvm.org/D47157 rdar://problem/37077034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335375 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Warning for framework headers using double quote includes"Bruno Cardoso Lopes2018-06-211-5/+0
| | | | | | | | | | | This reverts commit 9b5ff2db7e31c4bb11a7d468260b068b41c7c285. Broke bots: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11315 http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/10411/steps/test-check-all/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335195 91177308-0d34-0410-b5e6-96231b3b80d8
* Warning for framework headers using double quote includesBruno Cardoso Lopes2018-06-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce -Wquoted-include-in-framework-header, which should fire a warning whenever a quote include appears in a framework header and suggest a fix-it. For instance, for header A.h added in the tests, this is how the warning looks like: ./A.framework/Headers/A.h:2:10: warning: double-quoted include "A0.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header] #include "A0.h" ^~~~~~ <A/A0.h> ./A.framework/Headers/A.h:3:10: warning: double-quoted include "B.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header] #include "B.h" ^~~~~ <B.h> This helps users to prevent frameworks from using local headers when in fact they should be targetting system level ones. The warning is off by default. Differential Revision: https://reviews.llvm.org/D47157 rdar://problem/37077034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335184 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Warning for module declarations lacking 'framework' qualifierBruno Cardoso Lopes2018-06-011-0/+5
| | | | | | | | | | | | | | | When a module declaration for a framework lacks the 'framework' qualifier, the listed headers aren't found (because there's no trigger for the special framework style path lookup) and the module is silently not built. This leads to frameworks not being modularized by accident, which is pretty bad. Add a warning and suggest the user to add the 'framework' qualifier when we can prove that it's the case. rdar://problem/39193062 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333718 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve unknown STDC pragma through preprocessorSteven Wu2018-01-051-5/+0
| | | | | | | | | | | | | | | | | | | Summary: #pragma STDC FP_CONTRACT handler is only registered in parser so we should keep the unknown STDC pragma through preprocessor and we also should not emit warning for unknown STDC pragma during preprocessor. rdar://problem/35724351 Reviewers: efriedma, rsmith, arphaman Reviewed By: efriedma Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41780 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321909 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Change private modules rules and warningsBruno Cardoso Lopes2017-12-221-4/+8
| | | | | | | | | | | | | | | | We used to advertise private modules to be declared as submodules (Foo.Private). This has proven to not scale well since private headers might carry several dependencies, introducing unwanted content into the main module and often causing dep cycles. Change the canonical way to name it to Foo_Private, forcing private modules as top level ones, and provide warnings under -Wprivate-module to suggest fixes for other private naming. Update documentation to reflect that. rdar://problem/31173501 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321337 91177308-0d34-0410-b5e6-96231b3b80d8
* Warn if we find a Unicode homoglyph for a symbol in an identifier.Richard Smith2017-12-141-0/+3
| | | | | | | | | | | | | | | | | Specifically, warn if: * we find a character that the language standard says we must treat as an identifier, and * that character is not reasonably an identifier character (it's a punctuation character or similar), and * it renders identically to a valid non-identifier character in common fixed-width fonts. Some tools "helpfully" substitute the surprising characters for the expected characters, and replacing semicolons with Greek question marks is a common "prank". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320697 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] P0515R3: lexer support for new <=> token.Richard Smith2017-12-011-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319509 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a flag group to turn on/off all "binary literals" extension warnings.Richard Smith2017-10-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316056 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] Fix failing regression test related to not adding the extension ↵Faisal Vali2017-10-151-2/+5
| | | | | | | | | | | | | | warning to a diagnostic group (in r315840) In passing also complete a comment that I left uncompleted. For ease of reference, here's the parent commit: https://reviews.llvm.org/rL315840 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315842 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] Implement P0306 __VA_OPT__ (Comma omission and comma deletion)Faisal Vali2017-10-151-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements an extension to the preprocessor: __VA_OPT__(contents) --> which expands into its contents if variadic arguments are supplied to the parent macro, or behaves as an empty token if none. - Currently this feature is only enabled for C++2a (this could be enabled, with some careful tweaks, for other dialects with the appropriate extension or compatibility warnings) - The patch was reviewed here: https://reviews.llvm.org/D35782 and asides from the above (and moving some of the definition and expansion recognition logic into the corresponding state machines), I believe I incorporated all of Richard's suggestions. A few technicalities (most of which were clarified through private correspondence between rsmith, hubert and thomas) are worth mentioning. Given: #define F(a,...) a #__VA_OPT__(a ## a) a ## __VA_OPT__(__VA_ARGS__) - The call F(,) Does not supply any tokens for the variadic arguments and hence VA_OPT behaves as a placeholder. - When expanding VA_OPT (for e.g. F(,1) token pasting occurs eagerly within its contents if the contents need to be stringified. - A hash or a hashhash prior to VA_OPT does not inhibit expansion of arguments if they are the first token within VA_OPT. - When a variadic argument is supplied, argument substitution occurs within the contents as does stringification - and these resulting tokens are inserted back into the macro expansions token stream just prior to the entire stream being rescanned and concatenated. See wg21.link/P0306 for further details on the feature. Acknowledgment: This patch would have been poorer if not for Richard Smith's usual thoughtful analysis and feedback. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315840 91177308-0d34-0410-b5e6-96231b3b80d8
* [Module map] Introduce a private module re-export directive.Douglas Gregor2017-09-141-0/+7
| | | | | | | | | | | | | Introduce a new "export_as" directive for top-level modules, which indicates that the current module is a "private" module whose symbols will eventually be exported through the named "public" module. This is in support of a common pattern in the Darwin ecosystem where a single public framework is constructed of several private frameworks, with (currently) header duplication and some support from the linker. Addresses rdar://problem/34438420. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313316 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename diagnostic groups from CXX1z to CXX17. No functionality change.Richard Smith2017-08-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311758 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename cxx1z -> cxx17 across all diagnostic IDs.Richard Smith2017-08-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310805 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace remaining user-visible mentions of C++1z with C++17.Richard Smith2017-08-131-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310804 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] Treat 'concept' and 'requires' as keywords, add compat warning for ↵Richard Smith2017-08-131-0/+2
| | | | | | C++17 and before. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310803 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply Sema: allow imaginary constants via GNU extension if UDL overloads ↵Tim Northover2017-08-091-2/+0
| | | | | | | | | | | | | | | | | | not present. C++14 added user-defined literal support for complex numbers so that you can write something like "complex<double> val = 2i". However, there is an existing GNU extension supporting this syntax and interpreting the result as a _Complex type. This changes parsing so that such literals are interpreted in terms of C++14's operators if an overload is present but otherwise falls back to the original GNU extension. (We now have more robust diagnostics for implicit conversions so the libc++ test that caused the original revert still passes). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310478 91177308-0d34-0410-b5e6-96231b3b80d8
* Add #pragma clang module build/endbuild pragmas for performing a module buildRichard Smith2017-06-091-0/+4
| | | | | | | | | | | | | | | | as part of a compilation. This is intended for two purposes: 1) Writing self-contained test cases for modules: we can now write a single source file test that builds some number of module files on the side and imports them. 2) Debugging / test case reduction. A single-source testcase is much more amenable to reduction, compared to a VFS tarball or .pcm files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305101 91177308-0d34-0410-b5e6-96231b3b80d8
* Support lazy stat'ing of files referenced by module maps.Richard Smith2017-06-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for a `header` declaration in a module map to specify certain `stat` information (currently, size and mtime) about that header file. This has two purposes: - It removes the need to eagerly `stat` every file referenced by a module map. Instead, we track a list of unresolved header files with each size / mtime (actually, for simplicity, we track submodules with such headers), and when attempting to look up a header file based on a `FileEntry`, we check if there are any unresolved header directives with that `FileEntry`'s size / mtime and perform deferred `stat`s if so. - It permits a preprocessed module to be compiled without the original files being present on disk. The only reason we used to need those files was to get the `stat` information in order to do header -> module lookups when using the module. If we're provided with the `stat` information in the preprocessed module, we can avoid requiring the files to exist. Unlike most `header` directives, if a `header` directive with `stat` information has no corresponding on-disk file the enclosing module is *not* marked unavailable (so that behavior is consistent regardless of whether we've resolved a header directive, and so that preprocessed modules don't get marked unavailable). We could actually do this for all `header` directives: the only reason we mark the module unavailable if headers are missing is to give a diagnostic slightly earlier (rather than waiting until we actually try to build the module / load and validate its .pcm file). Differential Revision: https://reviews.llvm.org/D33703 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304515 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose attempts to build a preprocessed module that defines an unavailable ↵Richard Smith2017-05-301-0/+2
| | | | | | | | | | submodule. The errors we would otherwise get are incomprehensible, as we would enter the module but not make its contents visible to itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304190 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Sema: allow imaginary constants via GNU extension if UDL overloads ↵Tim Northover2017-05-241-0/+2
| | | | | | | | | not present." This reverts commit r303697. It broke libc++ tests that were specifically checking incompatibility in C++14 mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303813 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: allow imaginary constants via GNU extension if UDL overloads not present.Tim Northover2017-05-231-2/+0
| | | | | | | | | | | | | C++14 added user-defined literal support for complex numbers so that you can write something like "complex<double> val = 2i". However, there is an existing GNU extension supporting this syntax and interpreting the result as a _Complex type. This changes parsing so that such literals are interpreted in terms of C++14's operators if an overload is present but otherwise falls back to the original GNU extension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303694 91177308-0d34-0410-b5e6-96231b3b80d8
* Add #pragma clang module begin/end pragmas and generate them when ↵Richard Smith2017-05-041-2/+16
| | | | | | | | | | | | | | | preprocessing a module. These pragmas are intended to simulate the effect of entering or leaving a file with an associated module. This is not completely implemented yet: declarations between the pragmas will not be attributed to the correct module, but macro visibility is already functional. Modules named by #pragma clang module begin must already be known to clang (in some module map that's either loaded or on the search path). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302098 91177308-0d34-0410-b5e6-96231b3b80d8
* Add pragma to perform module import and use it in -E output.Richard Smith2017-04-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | Many of our supported configurations support modules but do not have any first-class syntax to perform a module import. This leaves us with a problem: there is no way to represent the expansion of a #include that imports a module in the -E output for such languages. (We don't want to just leave it as a #include because that requires the consumer of the preprocessed source to have the same file system layout and include paths as the creator.) This patch adds a new pragma: #pragma clang module import MODULE.NAME.HERE that imports a module, and changes -E and -frewrite-includes to use it when rewriting a #include that maps to a module import. We don't make any attempt to use a native language syntax import if one exists, to get more consistent output. (If in the future, @import and #include have different semantics in some way, the pragma will track the #include semantics.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301725 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the -Wunknown-warning-option group for the "unknown warning group"Alex Lorenz2017-04-281-1/+1
| | | | | | | | | | | | diagnostic in #pragma diagnostic This matches the warning group that's specified for the unknown warning options that are passed-in as command line arguments. rdar://29526025 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301647 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for editor placeholders to ClangAlex Lorenz2017-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | This commit teaches Clang to recognize editor placeholders that are produced when an IDE like Xcode inserts a code-completion result that includes a placeholder. Now when the lexer sees a placeholder token, it emits an 'editor placeholder in source file' error and creates an identifier token that represents the placeholder. The parser/sema can now recognize the placeholders and can suppress the diagnostics related to the placeholders. This ensures that live issues in an IDE like Xcode won't get spurious diagnostics related to placeholders. This commit also adds a new compiler option named '-fallow-editor-placeholders' that silences the 'editor placeholder in source file' error. This is useful for an IDE like Xcode as we don't want to display those errors in live issues. rdar://31581400 Differential Revision: https://reviews.llvm.org/D32081 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300667 91177308-0d34-0410-b5e6-96231b3b80d8
* PR30508: Downgrade error to warning if the umbrella folder doesn't exist.Vassil Vassilev2017-04-181-2/+3
| | | | | | | Patch by Yuka Takahashi (D32119)! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300594 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build breakage in r290219. Notes should not be in diagnostic groups.Graydon Hoare2016-12-211-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290221 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Handle modules with nonstandard names in module.private.modulemapsGraydon Hoare2016-12-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The module system supports accompanying a primary module (say Foo) with an auxiliary "private" module (defined in an adjacent module.private.modulemap file) that augments the primary module when associated private headers are available. The feature is intended to be used to augment the primary module with a submodule (say Foo.Private), however some users in the wild are choosing to augment the primary module with an additional top-level module with a "similar" name (in all cases so far: FooPrivate). This "works" when a user of the module initially imports a private header, such as '#import "Foo/something_private.h"' since the Foo import winds up importing FooPrivate in passing. But if the import is subsequently recorded in a PCH file, reloading the PCH will fail to validate because of a cross-check that attempts to find the module.modulemap (or module.private.modulemap) using HeaderSearch algorithm, applied to the "FooPrivate" name. Since it's stored in Foo.framework/Modules, not FooPrivate.framework/Modules, the check fails and the PCH is rejected. This patch adds a compensatory workaround in the HeaderSearch algorithm when searching (and failing to find) a module of the form FooPrivate: the name used to derive filesystem paths is decoupled from the module name being searched for, and if the initial search fails and the module is named "FooPrivate", the filesystem search name is altered to remove the "Private" suffix, and the algorithm is run a second time (still looking for a module named FooPrivate, but looking in directories derived from Foo). Accompanying this change is a new warning that triggers when a user loads a module.private.modulemap that defines a top-level module with a different name from the top-level module defined in its adjacent module.modulemap. Reviewers: doug.gregor, manmanren, bruno Subscribers: bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D27852 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290219 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach clang-query to dump types. I couldn't find any existing tests for ↵Richard Smith2016-11-021-1/+1
| | | | | | clang-query's dumping functionality. =( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285869 91177308-0d34-0410-b5e6-96231b3b80d8
* Module: improve the diagnostic message for include of non-modular header.Manman Ren2016-10-211-2/+2
| | | | | | | | | Emit the actual path to the non-modular include. rdar://28897010 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284897 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-131-0/+8
| | | | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Re-commit of r272562 after addressing clang-x86-win2008-selfhost failure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272584 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r272562 for build bot failure (clang-x86-win2008-selfhost)Taewook Oh2016-06-131-7/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272572 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-131-1/+8
| | | | | | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Re-commit after addressing issues with of generating too many warnings for Windows and asan test failures. Patch by Eric Niebler git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272562 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert commit r271708Taewook Oh2016-06-041-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271761 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-031-0/+4
| | | | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Patch by Eric Niebler git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271708 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve diagnostic for the case when a non-defined function-like macro is usedRichard Smith2016-04-161-0/+2
| | | | | | | in a preprocessor constant expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266495 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused diagnostics. NFC.Benjamin Kramer2016-04-121-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266057 91177308-0d34-0410-b5e6-96231b3b80d8
* Consolidate and improve the handling of built-in feature-like macrosAndy Gibbs2016-04-051-0/+1
| | | | | | | | | | | | | | | | | | Summary: The parsing logic has been separated out from the macro implementation logic, leading to a number of improvements: * Gracefully handle unexpected/invalid tokens, too few, too many and nested parameters * Provide consistent behaviour between all built-in feature-like macros * Simplify the implementation of macro logic * Fix __is_identifier to correctly return '0' for non-identifiers Reviewers: doug.gregor, rsmith Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D17149 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265381 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose missing macro argument following charize operator.Andy Gibbs2016-04-011-1/+1
| | | | | | | | For completeness, add a test-case for the equivalent stringize operator diagnostic too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265177 91177308-0d34-0410-b5e6-96231b3b80d8
* Update diagnostics now that hexadecimal literals look likely to be part of ↵Richard Smith2016-03-041-3/+10
| | | | | | C++17. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262753 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename -Wexpansion-to-undefined to -Wexpansion-to-defined.Nico Weber2016-01-191-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258131 91177308-0d34-0410-b5e6-96231b3b80d8