summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p11.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge using-decl-pr17575.cpp into existing test case.Peter Collingbourne2014-03-051-0/+6
| | | | llvm-svn: 202925
* DR101, PR12770: If a function is declared in the same context as aRichard Smith2014-02-061-7/+19
| | | | | | | | using-declaration, and they declare the same function (either because the using-declaration is in the same namespace as the declaration it imports, or because they're both extern "C"), they do not conflict. llvm-svn: 200897
* Fix PR10447: lazily building name lookup tables for DeclContexts was broken.Richard Smith2012-03-131-6/+4
| | | | | | | | | | | | | | | | | | | | | | | The deferred lookup table building step couldn't accurately tell which Decls should be included in the lookup table, and consequently built different tables in some cases. Fix this by removing lazy building of DeclContext name lookup tables. In practice, the laziness was frequently not worthwhile in C++, because we performed lookup into most DeclContexts. In C, it had a bit more value, since there is no qualified lookup. In the place of lazy lookup table building, we simply don't build lookup tables for function DeclContexts at all. Such name lookup tables are not useful, since they don't capture the scoping information required to correctly perform name lookup in a function scope. The resulting performance delta is within the noise on my testing, but appears to be a very slight win for C++ and a very slight loss for C. The C performance can probably be recovered (if it is a measurable problem) by avoiding building the lookup table for the translation unit. llvm-svn: 152608
* Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:Richard Smith2012-01-121-8/+8
| | | | | | | | | | | | | | | | | | | | | | | - If the declarator is at the start of a line, and the previous line contained another declarator and ended with a comma, then that comma was probably a typo for a semicolon: int n = 0, m = 1, l = 2, // k = 5; myImportantFunctionCall(); // oops! - If removing the parentheses would correctly initialize the object, then produce a note suggesting that fix. - Otherwise, if there is a simple initializer we can suggest which performs value-initialization, then provide a note suggesting a correction to that initializer. Sema::Declarator now tracks the location of the comma prior to the declarator in the declaration, if there is one, to facilitate providing the note. The code to determine an appropriate initializer from the -Wuninitialized warning has been factored out to allow use in both that and -Wvexing-parse. llvm-svn: 148072
* David Blaikie and Chandler would like us to diagnoseRichard Smith2012-01-061-6/+6
| | | | | | | | int f(); in function scopes under -Wvexing-parse, so now we do. llvm-svn: 147649
* Tweak to r147599 for PR10828: Move the check from the parser into sema, and useRichard Smith2012-01-061-6/+6
| | | | | | | the Semantic Powers to only warn on class types (or dependent types), where the constructor or destructor could do something interesting. llvm-svn: 147642
* PR10828: Produce a warning when a no-arguments function is declared in blockRichard Smith2012-01-051-7/+6
| | | | | | | | | | | | | | | | | scope, when no other indication is provided that the user intended to declare a function rather than a variable. Remove some false positives from the existing 'parentheses disambiguated as a function' warning by suppressing it when the declaration is marked as 'typedef' or 'extern'. Add a new warning group -Wvexing-parse containing both of these warnings. The new warning is enabled by default; despite a number of false positives (and one bug) in clang's test-suite, I have only found genuine bugs with it when running it over a significant quantity of real C++ code. llvm-svn: 147599
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Actually try to trigger the last diagnostic in the declaration-collision ↵John McCall2009-12-101-4/+9
| | | | | | | | | test case. Surprisingly, we *do* diagnose one of them. Since we don't really track scopes into instantiation, this has to signal some kind of bug. llvm-svn: 91063
* Improve the diagnostic when a new declaration conflicts with a using shadowJohn McCall2009-12-101-0/+89
declaration. Rename note_using_decl to note_using, which is possibly less confusing. Add a test for non-class-scope using decl collisions and be sure to note the case we can't diagnose yet. llvm-svn: 91057
OpenPOWER on IntegriCloud