summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/elaborated-type-specifier.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Test what happens when tag lookup and redeclaration lookup disagreeReid Kleckner2016-10-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | Clang has a diagnostic for the what happens when an elaborated type implicitly creates a tag declaration and the initial tag lookup fails, but the redeclaration lookup succeeds and finds a non-tag type. However, it wasn't tested, and looked like dead code. After much staring, we discovered how to exercise it, and are now committing the test for posterity. In this example, the tag lookup will not find A, but then when we go to insert a declaration of A at global scope, we discover the template friend, which is not a tag type. struct C { template <typename> friend struct A; }; struct B { struct A *p; }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283235 91177308-0d34-0410-b5e6-96231b3b80d8
* When we generate a redeclaration for anJohn McCall2014-05-141-0/+9
| | | | | | | elaborated-type-specifier, place it in the correct context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208799 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow CorrectTypo to add/modify nested name qualifiers to typos thatKaelyn Uhrain2012-06-061-5/+2
| | | | | | | | | are otherwise too short to try to correct. The TODOs added to two of the tests are for existing deficiencies in the typo correction code that could be exposed by using longer identifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158109 91177308-0d34-0410-b5e6-96231b3b80d8
* When we run into an error parsing or type-checking the left-hand sideDouglas Gregor2010-09-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | of a binary expression, continue on and parse the right-hand side of the binary expression anyway, but don't call the semantic actions to type-check. Previously, we would see the error and then, effectively, skip tokens until the end of the statement. The result should be more useful recovery, both in the normal case (we'll actually see errors beyond the first one in a statement), but it also helps code completion do a much better job, because we do "real" code completion on the right-hand side of an invalid binary expression rather than completing with the recovery completion. For example, given x = p->y if there is no variable named "x", we can still complete after the p-> as a member expression. Along the recovery path, we would have completed after the "->" as if we were in an expression context, which is mostly useless. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114225 91177308-0d34-0410-b5e6-96231b3b80d8
* Whenever we complain about a failed initialization of a function orDouglas Gregor2010-04-221-1/+1
| | | | | | | | | | | | | | | | | | | method parameter, provide a note pointing at the parameter itself so the user does not have to manually look for the function/method being called and match up parameters to arguments. For example, we now get: t.c:4:5: warning: incompatible pointer types passing 'long *' to parameter of type 'int *' [-pedantic] f(long_ptr); ^~~~~~~~ t.c:1:13: note: passing argument to parameter 'x' here void f(int *x); ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102038 91177308-0d34-0410-b5e6-96231b3b80d8
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-1/+1
| | | | | | | | | | | | therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag). Most of these testcase changes were done by script, so don't feel too sorry for my fingers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch initialization of parameters in a call over toDouglas Gregor2009-12-221-1/+1
| | | | | | | | | | | | | InitializationSequence (when a FunctionDecl is present). This required a few small fixes to initialization sequences: - Make sure to use the adjusted parameter type for initialization of function parameters. - Implement transparent union calling semantics in C git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91902 91177308-0d34-0410-b5e6-96231b3b80d8
* 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for comparing pointers with <, >, <=, >=, ==, and !=Douglas Gregor2009-05-041-2/+1
| | | | | | | | | | | | | | | | in C++, taking into account conversions to the "composite pointer type" so that we can compare, e.g., a pointer to a derived class to a pointer to a base class. Also, upgrade the "comparing distinct pointer types" from a warning to an error for C++, since this is clearly an error. Turns out that we hadn't gone through and audited this code for C++, ever. Fixes <rdar://problem/6816420>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70829 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | | Tests and drivers updated, still need to shuffle dirs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
* Print the context of tag types as part of pretty-printing, e.g.,Douglas Gregor2009-03-191-1/+1
| | | | | | | | struct N::M::foo git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67284 91177308-0d34-0410-b5e6-96231b3b80d8
* When we see a reference to a struct, class, or union like "struct X"Douglas Gregor2009-01-091-0/+48
that is neither a definition nor a forward declaration and where X has not yet been declared as a tag, introduce a declaration into the appropriate scope (which is likely *not* to be the current scope). The rules for the placement of the declaration differ slightly in C and C++, so we implement both and test the various corner cases. This implementation isn't 100% correct due to some lingering issues with the function prototype scope (for a function parameter list) not being the same scope as the scope of the function definition. Testcase is FIXME'd; this probably isn't an important issue. Addresses <rdar://problem/6484805>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62014 91177308-0d34-0410-b5e6-96231b3b80d8