summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx0x-condition.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add a "vexing parse" warning for ambiguity between a variable declaration and aRichard Smith2017-09-291-2/+2
| | | | | | | | | | | | | | function-style cast. This fires for cases such as T(x); ... where 'x' was previously declared and T is a type. This construct declares a variable named 'x' rather than the (probably expected) interpretation of a function-style cast of 'x' to T. llvm-svn: 314570
* Re-commit r273548, reverted in r273589, with a fix to not produceRichard Smith2016-06-231-2/+2
| | | | | | | | | | | | | | | | -Wfor-loop-analysis warnings for a for-loop with a condition variable. In such a case, the loop condition variable is modified on each iteration of the loop by definition. Original commit message: Rearrange condition handling so that semantic checks on a condition variable are performed before the other substatements of the construct are parsed, rather than deferring them until the end. This allows better error recovery from semantic errors in the condition, improves diagnostic order, and is a prerequisite for C++17 constexpr if. llvm-svn: 273600
* Revert r273548, "Rearrange condition handling so that semantic checks on a ↵Peter Collingbourne2016-06-231-2/+2
| | | | | | | | condition variable" as it caused a regression in -Wfor-loop-analysis. llvm-svn: 273589
* Rearrange condition handling so that semantic checks on a condition variableRichard Smith2016-06-231-2/+2
| | | | | | | | | are performed before the other substatements of the construct are parsed, rather than deferring them until the end. This allows better error recovery from semantic errors in the condition, improves diagnostic order, and is a prerequisite for C++17 constexpr if. llvm-svn: 273548
* Cleaning up the self initialization checker.Richard Trieu2012-10-011-4/+5
| | | | | | | | | | | -Allow Sema to do more processing on the initial Expr before checking it. -Remove the special conditions in HandleExpr() -Move the code so that only one call site is needed. -Removed the function from Sema and only call it locally. -Warn on potentially evaluated reference variables, not just casts to r-values. -Update tests. llvm-svn: 164951
* Update parser's disambiguation to cope with braced function-style casts inRichard Smith2012-02-231-4/+4
| | | | | | | | | C++11, and with braced-init-list initializers in conditions. This exposed an ambiguity with enum underlying types versus bitfields, which we resolve by treating 'enum E : T {' as always defining an enumeration (even if it would only successfully parse as a bitfield). This appears to be g++ compatible. llvm-svn: 151227
* Accept braced-init-lists in conditions, and, in passing, dramatically improveRichard Smith2012-02-221-0/+37
the diagnostic for using a parenthesized direct-initializer in a condition. llvm-svn: 151137
OpenPOWER on IntegriCloud