Commit Graph

48197 Commits

Author SHA1 Message Date
Nick Lewycky acfcd0d51b Add -fno-unsigned-char and ignore it. We already support -fno-signed-char, add
both flags to the driver test.

llvm-svn: 191486
2013-09-27 05:06:31 +00:00
NAKAMURA Takumi f2bc8f35a2 NumericLiteralParser::ParseNumberStartingWithZero(): Try to appease MSC16's miscompilation.
Investigating yet. It seems msc16 miscompiles s[1] to be folded.

llvm-svn: 191485
2013-09-27 04:42:28 +00:00
David Majnemer c185aa7d92 Sema: Respect -fdelayed-template-parsing when parsing constexpr functions
Functions declared as constexpr must have their parsing delayed in
-fdelayed-template-parsing mode so as not to upset later template
instantiation.

N.B. My reading of the standard makes it seem like delayed template
parsing is at odds with constexpr.  We may want to make refinements in
other places in clang to make constexpr play nicer with this feature.

This fixes PR17334.

llvm-svn: 191484
2013-09-27 04:14:12 +00:00
Craig Topper 61f71c3903 Remove some stray underscores from copyright block. Fix first line length to match length of the one after the copyright block.
llvm-svn: 191483
2013-09-27 03:57:18 +00:00
Fariborz Jahanian 7c1a445c9e ObjectiveC migrator: Donlt annotate NS_RETURNS_INNER_POINTER
on class methods, as it makes no sense. // rdar://15069200

llvm-svn: 191468
2013-09-26 22:43:41 +00:00
Fariborz Jahanian 73466cafc1 ObjectiveC migrator: function pointer is not an
inner pointer for annotation to
objc_returns_inner_pointer purposes.
// rdar://15044991

llvm-svn: 191465
2013-09-26 21:43:47 +00:00
Adrian Prantl 179af903d2 Debug info: Fix a crash when trying to construct a type with redundant
ownership qualifiers.
Fixes rdar://problem/14990656.

llvm-svn: 191463
2013-09-26 21:35:50 +00:00
Faisal Vali 6440fcbee0 Remove an unused variable - thanks to Nick Lewycky for pointing this out!
llvm-svn: 191462
2013-09-26 21:32:23 +00:00
Kaelyn Uhrain f73430183a Fix error recovery when a return type correction includes a new name specifier.
llvm-svn: 191459
2013-09-26 21:13:05 +00:00
Bob Wilson a1b4206a70 Fix up fallout from r187156.
The previous change caused the driver to translate -Wa,-L to the
-msave-temp-labels option for cc1as, but cc1as did not accept that option.
This patch follows the same approach used for similar options (-relax-all,
-noexecstack) in the previous patch.

llvm-svn: 191458
2013-09-26 21:00:51 +00:00
Faisal Vali 2b391ab708 Implement a rudimentary form of generic lambdas.
Specifically, the following features are not included in this commit:
  - any sort of capturing within generic lambdas 
  - generic lambdas within template functions and nested 
    within other generic lambdas
  - conversion operator for captureless lambdas
  - ensuring all visitors are generic lambda aware
  (Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit)

As an example of what compiles through this commit:

template <class F1, class F2>
struct overload : F1, F2 {
    using F1::operator();
    using F2::operator();
    overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
  };

  auto Recursive = [](auto Self, auto h, auto ... rest) {
    return 1 + Self(Self, rest...);
  };
  auto Base = [](auto Self, auto h) {
      return 1;
  };
  overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
  int num_params =  O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

This patch has been reviewed by Doug and Richard.  Minor changes (non-functionality affecting) have been made since both of them formally looked at it, but the changes involve removal of supernumerary return type deduction changes (since they are now redundant, with richard having committed a recent patch to address return type deduction for C++11 lambdas using C++14 semantics). 



Some implementation notes:

  - Add a new Declarator context => LambdaExprParameterContext to 
    clang::Declarator to allow the use of 'auto' in declaring generic
    lambda parameters
      
  - Add various helpers to CXXRecordDecl to facilitate identifying
    and querying a closure class
  
  - LambdaScopeInfo (which maintains the current lambda's Sema state)
    was augmented to house the current depth of the template being
    parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
    so that SemaType.cpp::ConvertDeclSpecToType may use it to immediately 
    generate a template-parameter-type when 'auto' is parsed in a generic
    lambda parameter context.  (i.e we do NOT use AutoType deduced to 
    a template parameter type - Richard seemed ok with this approach).  
    We encode that this template type was generated from an auto by simply
    adding $auto to the name which can be used for better diagnostics if needed.

  - SemaLambda.h was added to hold some common lambda utility
    functions (this file is likely to grow ...)
    
  - Teach Sema::ActOnStartOfFunctionDef to check whether it
    is being called to instantiate a generic lambda's call
    operator, and if so, push an appropriately prepared
    LambdaScopeInfo object on the stack.
    
  - various tests were added - but much more will be needed.

There is obviously more work to be done, and both Richard (weakly) and Doug (strongly) 
have requested that LambdaExpr be removed form the CXXRecordDecl LambdaDefinitionaData
in a future patch which is forthcoming.

A greatful thanks to all reviewers including Eli Friedman, James Dennett, 
and especially the two gracious wizards (Richard Smith and Doug Gregor) 
who spent hours providing feedback (in person in Chicago and on the mailing lists).  
And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified!

Thanks!

llvm-svn: 191453
2013-09-26 19:54:12 +00:00
Kaelyn Uhrain deedc3a6bd Fix a bug in the typo correction replacement location.
I noticed the wrong text was being replaced with the correction while
working on expanding the "namespace-aware" typo correction to include
classes.

llvm-svn: 191450
2013-09-26 19:10:34 +00:00
Kaelyn Uhrain 95995be7a3 Teach typo correction to look inside of classes like it does namespaces.
Unlike with namespaces, searching inside of classes requires also
checking the access to correction candidates (i.e. don't suggest a
correction to a private class member for a correction occurring outside
that class and its methods or friends).

Included is a small (one line) fix for a bug, that was uncovered while
cleaning up the unit tests, where the decls from a TypoCorrection candidate
were preserved in new TypoCorrection candidates that are derived (copied)
from the old TypoCorrection--notably when creating a new candidate by
changing the NestedNameSpecifier associated with the base idenitifer.

llvm-svn: 191449
2013-09-26 19:10:29 +00:00
Richard Smith 52d0211ce3 Add macro test from N3781.
llvm-svn: 191444
2013-09-26 18:15:22 +00:00
Richard Smith 7f2707a7f4 Per updates to D3781, allow underscore under ' in a pp-number, and allow ' in a #line directive.
llvm-svn: 191443
2013-09-26 18:13:20 +00:00
Reid Kleckner af1acd9a5e clang-cl: Add /FI (forced include) as an alias for -include
Patch by Jeff Muizelaar, with added test case.

llvm-svn: 191442
2013-09-26 17:41:14 +00:00
Jordan Rose 3d08340b3c [driver] Ignore -fno-var-tracking; it's a GCC option we don't support.
-fvar-tracking (which IIUC is on by default in GCC) will still generate
an error.

llvm-svn: 191439
2013-09-26 17:03:34 +00:00
Rafael Espindola 64437be2c2 Remove fno_builtin_strcat and fno_builtin_strcpy.
They are already handled by the generic fno_bultin_, which also
avoids unused warnings.

llvm-svn: 191437
2013-09-26 16:45:27 +00:00
Benjamin Kramer 9b1dfe8b56 Mark an impossible path as unreachable to pacify GCC.
llvm-svn: 191436
2013-09-26 16:36:08 +00:00
Rafael Espindola c2b696d812 Remove -fbuiltin-strcat and -fbuiltin-strcpy.
These options don't exist in gcc and clang was not handling them.

llvm-svn: 191435
2013-09-26 16:21:53 +00:00
Rafael Espindola 07bed1386e Ignore unknown -fno-builtin-*.
This matches gcc's behavior.

llvm-svn: 191434
2013-09-26 16:15:40 +00:00
Rafael Espindola da3bfe06ad Remove unused parameter.
llvm-svn: 191433
2013-09-26 15:52:26 +00:00
Rafael Espindola fa74eee737 Ignore some -f options that are supported by gcc.
It is possible that we should say some of these are unsupported, but this is
not any worse than the old behavior of ignoring all unknown -f options.

llvm-svn: 191429
2013-09-26 13:10:14 +00:00
Benjamin Kramer 39c4924db9 Remove tabs.
llvm-svn: 191427
2013-09-26 12:16:47 +00:00
Richard Smith 99dc071104 Fix buildbot breakage.
llvm-svn: 191424
2013-09-26 05:57:03 +00:00
Richard Smith 1e130489b3 Replace a bool with an enum for clarity, based on review comment from James Dennett.
llvm-svn: 191420
2013-09-26 04:19:11 +00:00
Richard Smith 10b55fc85e If a partial specialization of a member template is declared within a class
template and defined outside it, don't instantiate it twice when instantiating
the surrounding class template specialization. That would cause us to reject
the code because we think two partial specializations instantiated to produce
the same signature.

llvm-svn: 191418
2013-09-26 03:49:48 +00:00
Richard Smith fde9485297 Implement C++1y digit separator proposal (' as a digit separator). This is not
yet approved by full committee, but was unanimously supported by EWG.

llvm-svn: 191417
2013-09-26 03:33:06 +00:00
Alexey Bataev 7d2960bd2a [OPENMP] Improved variable lookup procedure for threadprivate variables.
llvm-svn: 191416
2013-09-26 03:24:06 +00:00
Hans Wennborg 736a02931e Provide inline definitions of _Unwind_GetIP etc. for ARM in unwind.h
These symbols were showing up as undefined when trying to link programs on
Android. We should match libgcc's behaviour and provide inline definitions
of these on ARM.

It seems unwind.h on ARM/Darwin doesn't provide inline definitions, so we
just declare them for that platform.

llvm-svn: 191406
2013-09-25 22:34:03 +00:00
Reid Kleckner c5cc338ab3 Remove unused param from MicrosoftMangle::mangleCallingConvention()
llvm-svn: 191405
2013-09-25 22:28:52 +00:00
Mark Lacey ac57690895 Update NumTypeBits on Type to match the actual number of used bits.
llvm-svn: 191404
2013-09-25 22:25:21 +00:00
Fariborz Jahanian b7c5f74264 ObjectiveC: Handle the case of qualifying protocols
declared in a typedef declaraton used as super
class of an ObjC class. Curretnly, these protocols
are dropped from the class hierarchy. Test shows that
it is now included. // rdar://15051465

llvm-svn: 191395
2013-09-25 19:36:32 +00:00
Rafael Espindola cf526ee99c Produce an error for unknown -f options.
llvm-svn: 191394
2013-09-25 19:07:08 +00:00
Reid Kleckner 95e036c669 PR17359: Fix off-by-one OOB on _Pragma("") and an unescaping bug
Previously the code would reduce a run of backslashes to a single
backslash, and now it will properly leave behind every other backslash.

llvm-svn: 191382
2013-09-25 16:42:48 +00:00
Jordan Rose 1ccc43d50e [analyzer] Handle destructors for the argument to C++ 'delete'.
Now that the CFG includes nodes for the destructors in a delete-expression,
process them in the analyzer using the same common destructor interface
currently used for local, member, and base destructors. Also, check for when
the value is known to be null, in which case no destructor is actually run.

This does not yet handle destructors for deleted /arrays/, which may need
more CFG work. It also causes a slight regression in the location of
double delete warnings; the double delete is detected at the destructor
call, which is implicit, and so is reported on the first access within the
destructor instead of at the 'delete' statement. This will be fixed soon.

Patch by Karthik Bhat!

llvm-svn: 191381
2013-09-25 16:06:17 +00:00
Rafael Espindola cc707bc989 Produce an error if a -cc1 only option is passed to the driver.
llvm-svn: 191380
2013-09-25 15:54:41 +00:00
Rafael Espindola cbbe1d4454 Use -Xclang to pass -internal-isystem and -internal-externc-isystem to -cc1.
They are cc1 options only, so the driver was ignoring them.

llvm-svn: 191379
2013-09-25 15:47:05 +00:00
Rafael Espindola a844427cfa Move --relocatable-pch to Options.td.
It is a valid driver option (we have tests for that), so it should not be
marked as NoDriverOption.

No functionality change other than it showing in --help.

llvm-svn: 191377
2013-09-25 15:26:06 +00:00
Rafael Espindola 900485ab5f Don't pass -print-stats to the driver, it is a -cc1 option only.
llvm-svn: 191376
2013-09-25 15:21:56 +00:00
Daniel Jasper d94bff3721 clang-format: Option to removing the space before assignment operators.
Patch contributed by Aaron Wishnick. Thank you!

llvm-svn: 191375
2013-09-25 15:15:02 +00:00
Rafael Espindola 4c06c418ae Remove unused option.
llvm-svn: 191373
2013-09-25 14:31:29 +00:00
Benjamin Kramer 8b1a6bd8d0 Sema: Simplify code a bit, plug a potential leak.
No intended functionality change.

llvm-svn: 191370
2013-09-25 13:10:11 +00:00
NAKAMURA Takumi 64b1292bc2 StaticAnalyzer/Core/RegionStore.cpp: Prune one last "\param IsConst", as fixup to r191342. [-Wdocumentation]
llvm-svn: 191360
2013-09-25 08:17:20 +00:00
Richard Smith 4db51c23a4 Refactor to use C++1y 'auto' semantics directly in lambdas with no specified
return type in C++1y mode. No functionality change intended. Extracted and
tweaked from a patch by Faisal Vali!

llvm-svn: 191354
2013-09-25 05:02:54 +00:00
Fariborz Jahanian 7391a7b5aa ObjectiveC migrator. Don't suggest @property for
methods which look like getters but belong to
known family of methods. // rdar://15044058

llvm-svn: 191347
2013-09-25 00:17:07 +00:00
Argyrios Kyrtzidis 18d37b539e [libclang] python: fix return type of clang_Type_getSizeOf().
Patch by Loïc Jaquemet!

llvm-svn: 191346
2013-09-25 00:14:43 +00:00
Argyrios Kyrtzidis 16834f1cf9 [libclang] Provide location for attributes and expose 'packed' attribute.
Patch by Loïc Jaquemet!

llvm-svn: 191345
2013-09-25 00:14:38 +00:00
Anton Yartsev 424ad95fa7 [analyzer] This patch removes passing around of const-invalidation vs regular-invalidation info by passing around a datastructure that maps regions and symbols to the type of invalidation they experience. This simplifies the code and would allow to associate more different invalidation types in the future.
With this patch things like preserving contents of regions (either hi- or low-level ones) or processing of the only top-level region can be implemented easily without passing around extra parameters.

This patch is a first step towards adequate modeling of memcpy() by the CStringChecker checker and towards eliminating of majority of false-positives produced by the NewDeleteLeaks checker.

llvm-svn: 191342
2013-09-24 23:47:29 +00:00
Eli Friedman 3ce27103d9 Allow dynamic_cast to void* even with -fno-rtti.
PR17346.

llvm-svn: 191340
2013-09-24 23:21:41 +00:00
Eli Friedman 1f5d8882f9 Fix -Wmissing-variable-declarations regression.
This issue was introduced in r181677.

PR17349.

llvm-svn: 191339
2013-09-24 23:10:08 +00:00
Richard Smith 5acb759f39 Avoid a signed/unsigned comparison warning with compilers that don't know how
to handle constant expressions.

llvm-svn: 191336
2013-09-24 22:13:21 +00:00
Fariborz Jahanian 7797c0d0f7 ObjectiveC migrator: provide space between the property
keyword and the rest on suggested property. // rdar://15069044

llvm-svn: 191335
2013-09-24 21:27:58 +00:00
Fariborz Jahanian aaabfcdffe ObjectiveC migrator: Another test for my last patch.
// rdar://15044991

llvm-svn: 191334
2013-09-24 20:31:24 +00:00
Fariborz Jahanian 10b7435ceb ObjectiveC migrator: iDOn't mangle names when
NS_RETURNS_INNER_POINTER annotation is suggested on
a property. // rdar://15044991

llvm-svn: 191332
2013-09-24 20:20:52 +00:00
Rafael Espindola 4f3f5ade54 Produce an error for unknown -m options.
llvm-svn: 191328
2013-09-24 19:35:01 +00:00
Yunzhong Gao 1f6aeebe76 Adding -mtbm and -mno-tbm command line options to the clang front end for the
x86 TBM instruction set. Also adding a __TBM__ macro if the TBM feature is
enabled. Otherwise there should be no functionality change to existing features.

Phabricator code review is located here: http://llvm-reviews.chandlerc.com/D1693

llvm-svn: 191326
2013-09-24 19:00:58 +00:00
Hans Wennborg b6331dcb51 clang-cl: fix passing optimization level to cl.exe in /fallback mode
We were previously mostly passing it through, but -O0 and -O3 are not valid
options to cl.exe.

We should translate -O0 to /Od and -O3 to /Ox. -O{1,2,s} get passed through.

llvm-svn: 191323
2013-09-24 18:17:21 +00:00
Hans Wennborg 263c213061 clang-cl: pass /nologo when falling back to cl.exe
llvm-svn: 191316
2013-09-24 17:36:21 +00:00
Fariborz Jahanian 0dded8ab04 Revert my patch in r191155 to allow forward
class/protocol decls in @implementation and
fixup modern rewriter to handle that.
// rdar://15066233

llvm-svn: 191311
2013-09-24 17:03:07 +00:00
Rafael Espindola 96a051367b Use a valid option (-msse) for testing QA_OVERRIDE_GCC3_OPTIONS.
llvm-svn: 191300
2013-09-24 13:37:21 +00:00
Rafael Espindola bfd88f2c7e Remove a use of OPT_m_Joined.
This patch turns the -mv* hexagon options into aliases. We should really produce
errors for invalid versions in the driver, but this patch preserves the old
behavior for now.

llvm-svn: 191298
2013-09-24 13:28:24 +00:00
Daniel Jasper 9a59e2c688 Fix uninitialized value bug discovered buy msan buildbot.
llvm-svn: 191292
2013-09-24 12:30:27 +00:00
Daniel Jasper ca9f73812c Add -fmodule-map-file option.
With this option, arbitrarily named module map files can be specified
to be loaded as required for headers in the respective (sub)directories.

This, together with the extern module declaration allows for specifying
module maps in a modular fashion without the need for files called
"module.map".

Among other things, this allows a directory to contain two modules that
are completely independent of one another.

Review: http://llvm-reviews.chandlerc.com/D1697.
llvm-svn: 191284
2013-09-24 09:27:13 +00:00
Daniel Jasper ba7f2f7110 Module use declarations (II)
Review: http://llvm-reviews.chandlerc.com/D1546.

I have picked up this patch form Lawrence
(http://llvm-reviews.chandlerc.com/D1063) and did a few changes.

From the original change description (updated as appropriate):
This patch adds a check that ensures that modules only use modules they
have so declared. To this end, it adds a statement on intended module
use to the module.map grammar:

  use module-id

A module can then only use headers from other modules if it 'uses' them.
This enforcement is off by default, but may be turned on with the new
option -fmodules-decluse.

When enforcing the module semantics, we also need to consider a source
file part of a module. This is achieved with a compiler option

-fmodule-name=<module-id>.

The compiler at present only applies restrictions to the module directly
being built.

llvm-svn: 191283
2013-09-24 09:14:14 +00:00
Simon Atanasyan 22127cee34 [Mips] Support -mnan=2008 option. Define "__mips_nan2008" macros and pass
this option to the assembler.

llvm-svn: 191282
2013-09-24 09:09:16 +00:00
Richard Smith b12cf6ceb7 Hopefully unbreak bots which are seeing an assert in this test. Temporary, real
fix to come once I've tracked down the problem (which is pre-existing and not
related to the change which introduced this test).

llvm-svn: 191279
2013-09-24 05:07:58 +00:00
Richard Smith 300e0c36a3 Implement restriction that a partial specialization must actually specialize
something, for variable templates.

llvm-svn: 191278
2013-09-24 04:49:23 +00:00
NAKAMURA Takumi 788af10a8a CGBuiltin.cpp: Prune a stray default: label. [-Wcovered-switch-default]
llvm-svn: 191277
2013-09-24 04:37:50 +00:00
Richard Smith 2a98862be2 Handle standard libraries that miss out the space when defining the standard
literal operators. Also, for now, allow the proposed C++1y "il", "i", and "if"
suffixes too. (Will revert the latter if LWG decides not to go ahead with that
change after all.)

llvm-svn: 191274
2013-09-24 04:06:10 +00:00
Alexey Bataev 756c196f14 [OPENMP] Bug fixes and improvements.
1. Fixed constructor of shared clause.
2. Some macros for clauses processing are replaced by private template methods.
3. Additional checks in sema analysis of OpenMP clauses.

llvm-svn: 191265
2013-09-24 03:17:45 +00:00
Jiangning Liu 036f16dc8c Initial support for Neon scalar instructions.
Patch by Ana Pazos.

1.Added support for v1ix and v1fx types.
2.Added Scalar Pairwise Reduce instructions.
3.Added initial implementation of Scalar Arithmetic instructions.

llvm-svn: 191264
2013-09-24 02:48:06 +00:00
Rafael Espindola 25f007f054 Remove unused option.
gcc doesn't support "gcc -m sse" and this was not tested in clang and only
used for link argument on darwin, so this was very likely just a bug.

llvm-svn: 191251
2013-09-24 00:10:56 +00:00
Hans Wennborg f4aee18086 clang-cl: print diagnostics as "error(clang): foo" in /fallback mode
This solves two problems:

1) MSBuild will not flag the build as unsuccessful just because we print
   an error in the output, since "error(clang):" doesn't seem to match
   the regex it's using.

2) It becomes more clear that the diagnostic is coming from clang as
   supposed to cl.exe.

Differential Revision: http://llvm-reviews.chandlerc.com/D1735

llvm-svn: 191250
2013-09-24 00:08:55 +00:00
Rafael Espindola 8a2d496e18 Produce errors for unknown options.
This doesn't change a lot since clang still thinks it knows all of the
-f*, -m* and -W* options for example.

Other than the options clang explicitly claims to know, this fixes pr9701.

llvm-svn: 191249
2013-09-23 23:55:25 +00:00
Eli Friedman 3cd55f49ab Fix argument types of some AVX2 intrinsics.
This fix makes our headers consistent with gcc.

PR17312.

llvm-svn: 191248
2013-09-23 23:52:04 +00:00
Fariborz Jahanian 1a73b8f7d2 Remove extra space.
llvm-svn: 191246
2013-09-23 23:48:04 +00:00
Rafael Espindola 52ddfb3c16 Fix an incomplete copy and paste in my previous patch.
llvm-svn: 191245
2013-09-23 23:43:34 +00:00
Eli Friedman f9d8c6cebb Add _mm_stream_si64 intrinsic.
While I'm here, also fix the alignment computation for the whole family of
intrinsics.

PR17298.

llvm-svn: 191243
2013-09-23 23:38:39 +00:00
Rafael Espindola 05ccc50ba4 Add tests on how clang currently handles some unknown options.
This is not to say this is the desired behavior, but it makes sure we notice
if it changes.

llvm-svn: 191242
2013-09-23 23:27:32 +00:00
Fariborz Jahanian c71eb6adc3 ObjectiveC migrator. When migrating to property declaration
use Cocoa's naming convention for properties of ObjC
object type. // rdar://15045005

llvm-svn: 191240
2013-09-23 23:18:46 +00:00
Richard Smith 0b5511971e Revert change accidentally committed in r191150.
llvm-svn: 191237
2013-09-23 23:12:22 +00:00
Fariborz Jahanian 02bdb16524 ObjectiveC migrator: Infer NS_OPTIONS when if there is at
least one hex enumerator, all others are also
hex enumerator (0 enumerator is excepted). 
// rdar://15044304

llvm-svn: 191222
2013-09-23 20:27:06 +00:00
Kostya Serebryany bedc616804 Enable -fsanitize=use-after-return by default under -fsanitize=address
Summary:
We enable ASAN's use-after-return instrumentation at compile-time,
but still keep it disabled at run-time.
This enables the users to flip the flag at run-time using environment variable
ASAN_OPTIONS=detect_stack_use_after_return=1 instead of using a separate build.
If UAR detection is disabled at run-time, this extra compile-time instrumentation
costs very small slowdown. On SPEC 2006 14 tests are not affected at all,
4 tests get ~ 1% slowdown and 453.povray gets 4%.

Reviewers: samsonov

Reviewed By: samsonov

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1741

llvm-svn: 191186
2013-09-23 09:52:37 +00:00
Richard Smith 90061908f6 PR16529: Don't forget to add the CXXFunctionalCastExpr type sugar to an
InitListExpr for a C++11-style T{...} construction, if initialization
registered a destructor for it.

llvm-svn: 191182
2013-09-23 02:20:00 +00:00
Benjamin Kramer b8f33f1690 Make sort predicate match the qsort convention.
llvm-svn: 191177
2013-09-22 15:02:02 +00:00
Benjamin Kramer 04bf187e12 Fix array_pod_sort predicates after LLVM change.
llvm-svn: 191176
2013-09-22 14:10:29 +00:00
Benjamin Kramer 402f807d9d array_pod_sort loses some type safety, better use the right types.
llvm-svn: 191174
2013-09-22 12:53:24 +00:00
Benjamin Kramer a92b80f8a0 Rewrite a cold use of std::sort to array_pod_sort.
No functionality change.

llvm-svn: 191173
2013-09-22 12:41:24 +00:00
Nick Lewycky e2b2caaded Fix comment to match name of variable.
llvm-svn: 191171
2013-09-22 10:07:22 +00:00
Nick Lewycky 0f29289bb4 Simplify code to equivalent code. No need to test for null after cast<>, use
takeAs<> instead of cast<>(.take()). Fix 80-column violation in whitespace after
comment.

llvm-svn: 191170
2013-09-22 10:06:57 +00:00
Nick Lewycky ed4265c24e Fix typo. Add missing whitespace. No functionality change.
llvm-svn: 191169
2013-09-22 10:06:01 +00:00
David Majnemer 338a770eb9 Parse: Move simple-type-specifier sanity check earlier
No functional change, just makes the error handling a bit more obvious.

llvm-svn: 191162
2013-09-22 03:30:01 +00:00
David Majnemer a5e92556ac Parse: Don't crash during parsing if we lack a simple-type-specifier
Summary:
Parsing cast expressions during error recovery can put us in a bad
state.  Check to see if the token for a simple-type-specifier makes
sense before further parsing.

Fixes PR17255.

Reviewers: rsmith, doug.gregor, CornedBee, eli.friedman

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1696

llvm-svn: 191159
2013-09-22 01:24:26 +00:00
Fariborz Jahanian aa78931e91 ObjectiveC: ObjC declarations, including forward class
and protocols can be at global scope only.

llvm-svn: 191155
2013-09-22 00:02:16 +00:00
Richard Smith 089c31637f PR17295: Do not allow explicit conversion functions to be used in cases where
an additional conversion (other than a qualification conversion) would be
required after the explicit conversion.

Conversely, do allow explicit conversion functions to be used when initializing
a temporary for a reference binding in direct-list-initialization.

llvm-svn: 191150
2013-09-21 21:55:46 +00:00
Richard Smith 6c6ddabf7b Some comment updates and tweaks for clarity.
llvm-svn: 191147
2013-09-21 21:23:47 +00:00
Richard Smith aaa0ec45fe Rearrange narrowing checks in initialization to be a different form of step
rather than a post-processing action, so we can support inserting these checks
at stages other than the end of the initialization. No functionality change
intended.

llvm-svn: 191146
2013-09-21 21:19:19 +00:00
Daniel Jasper df620b2457 clang-format: Improve address-of-operator detection
Before:
  size = sizeof * a;

After:
  size = sizeof *a;

llvm-svn: 191139
2013-09-21 17:31:51 +00:00
Daniel Jasper cf627f0f7b Fix clang-format-diff.py to accept -style again.
Copy and paste error in r190935..

llvm-svn: 191137
2013-09-21 10:05:02 +00:00
Petar Jovanovic c19a284182 [Mips] Allocate NaClTargetInfo for MIPSEL NaCl
A patch to AllocateTarget function to recognize llvm::Triple::NaCl for
MIPSEL and return NaClTargetInfo. Additional test has been added to check
if the expected macros get defined.

llvm-svn: 191124
2013-09-21 01:27:01 +00:00
Eli Friedman 9b04f41899 Fix return type of _mm_extract_epi8 etc.
PR17300.

llvm-svn: 191120
2013-09-21 00:05:25 +00:00
Chandler Carruth 2c93cb2a6f Switch tests in test/Headers to use %clang_cc1 rather than %clang. There
is no need to go through the driver indirection here, and it clutters
things up as dependencies can sneak in for specific things the driver is
doing.

llvm-svn: 191107
2013-09-20 21:12:25 +00:00
Richard Smith 4e0d2e41b7 Refactor: CheckExplicitInitList is only called to check an entire InitListExpr,
so the Index in/out parameters are pointless (always passed in as 0, always
ignored by the caller).

llvm-svn: 191103
2013-09-20 20:10:22 +00:00
Hans Wennborg 188382eba5 clang-cl: implement custom search for cl.exe in /fallback mode
This solves the problem of fallback onto ourselves if clang-cl
has been renamed to cl.exe and put on the PATH, as happens with
the VS integration.

Differential Revision: http://llvm-reviews.chandlerc.com/D1731

llvm-svn: 191099
2013-09-20 18:16:35 +00:00
Reid Kleckner 1784d2fc9c Update -fmsc-version docs for r190908, which set the default to 1700
llvm-svn: 191098
2013-09-20 18:01:52 +00:00
Reid Kleckner eb248d7fd8 Fix ReST links I just added to the manual
llvm-svn: 191097
2013-09-20 17:54:39 +00:00
Reid Kleckner d128f8a252 Clarify that we silently ignore some MS extensions like IDL attributes
llvm-svn: 191096
2013-09-20 17:51:00 +00:00
Reid Kleckner 993e72a68e Use -fms-compatibility to trigger lookup into dep. bases
Update the docs for -fms-extensions and -fms-compatibility to try to
clarify the difference between the two.

llvm-svn: 191095
2013-09-20 17:04:25 +00:00
Jordan Rose 5770c038fe [analyzer] Use getParentIgnoreParenCasts instead of doing it by hand.
Apart from being more compact and already implemented, this also handles the
case where the parent is null. (It does also ignore all casts, not just
implicit ones, but this is more efficient to test and in the case we care
about---a message in a PseudoObjectExpr---there should only be implicit casts
anyway.

This should fix our internal buildbot.

llvm-svn: 191094
2013-09-20 16:51:50 +00:00
Alexander Potapenko 4462c5b5d6 [ASan] Fix darwin-sanitizer-ld.c to test for the new order of linker flags introduced by r191076.
llvm-svn: 191077
2013-09-20 08:23:19 +00:00
Alexander Potapenko ce87633ff9 [ASan] Do not imply -undefined dynamic_lookup when linking dylibs with -fsanitize=address.
Instead add the ASan runtime to the linker command line so that only the ASan API functions can be undefined in the target library.

Fixes http://llvm.org/bugs/show_bug.cgi?id=17275

llvm-svn: 191076
2013-09-20 08:09:51 +00:00
Richard Trieu 406e65c8d1 Modify the uninitialized field visitor to detect uninitialized use across the
fields in the class.  This allows a better checking of member intiailizers and
in class initializers in regards to initialization ordering.

For instance, this code will now produce warnings:

class A {
  int x;
  int y;
  A() : x(y) {}  // y is initialized after x, warn here
  A(int): y(x) {} // default initialization of leaves x uninitialized, warn here
};

Several test cases were updated with -Wno-uninitialized to silence this warning.

llvm-svn: 191068
2013-09-20 03:03:06 +00:00
Richard Smith b8c65f0136 Testcase I forgot to svn add in r191057.
llvm-svn: 191067
2013-09-20 02:48:08 +00:00
Richard Smith 541b38be7b Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.

llvm-svn: 191064
2013-09-20 01:15:31 +00:00
Richard Smith f7ec86a55b PR17290: Use 'false' macro in fix-it hint for initializing a variable of type
_Bool in C, if the macro is defined. Also teach FixItUtils to look at whether
the macro was defined at the source location for which it is creating a fixit,
rather than looking at whether it's defined *now*. This is especially relevant
for analysis-based warnings which are delayed until end of TU.

llvm-svn: 191057
2013-09-20 00:27:40 +00:00
Kaelyn Uhrain aee2ebe5a5 Don't correct typos in Sema::BuildCXXNestedNameSpecifier with -fms-extensions
When -fms-extensions is enabled, the typo correction was being called here on
non-error paths (as in test/SemaTemplate/lookup-dependent-bases.cpp) and correct
compilation depended on Sema::CorrectTypo not finding a viable candidate.

llvm-svn: 191046
2013-09-19 22:38:48 +00:00
Hans Wennborg 87cfa71071 clang-cl: implement /fallback mode
When this flag is enabled, clang-cl falls back to cl.exe if it
cannot compile the code itself for some reason.

The idea is to use this to help build projects that almost compile
with clang-cl, except for some files that can then be built with
the fallback mechanism.

Differential Revision: http://llvm-reviews.chandlerc.com/D1711

llvm-svn: 191034
2013-09-19 20:32:16 +00:00
Fariborz Jahanian 8bf05566d7 Fixes a buildbot failure (was using local
type in template instantiation).

llvm-svn: 191022
2013-09-19 17:52:50 +00:00
Fariborz Jahanian 5c005839f6 Refinement to my previous patch for
objc_returns_inner_pointer on properties. // rdar://14990439

llvm-svn: 191016
2013-09-19 17:18:55 +00:00
Reid Kleckner 81e6a60efa clang-cl: Accept -fmsc-version so we can set it without -Xclang
llvm-svn: 191011
2013-09-19 17:00:54 +00:00
Fariborz Jahanian 8a5e947454 ObjectiveC: Allow NS_RETURNS_INNER_POINTER annotation
of ObjectiveC properties to mean annotation of 
NS_RETURNS_INNER_POINTER on its synthesized getter.
This also facilitates more migration to properties when 
methods are annotated with NS_RETURNS_INNER_POINTER. 
// rdar://14990439

llvm-svn: 191009
2013-09-19 16:37:20 +00:00
Ben Langmuir ed6e97d2c3 Fix ifdef macro missed in previous commit
llvm-svn: 191003
2013-09-19 14:07:14 +00:00
Ben Langmuir 6efe3a886e Move sha intrinsics to immintrin.h
This is consistent with ICC and Intel's SHA-enabled GCC version.

llvm-svn: 191002
2013-09-19 14:00:22 +00:00
Amara Emerson fc362c62bf [ARMv8] Add crypto-neon-fp-armv8 -mfpu option in driver.
llvm-svn: 191001
2013-09-19 13:54:03 +00:00
Ben Langmuir 58078d0103 Add C intrinsics for Intel SHA Extensions
Intrinsics added shaintrin.h, which is included from x86intrin.h if __SHA__ is
enabled. SHA implies SSE2, which is needed for the __m128i type.

Also add the -msha/-mno-sha option.

llvm-svn: 190999
2013-09-19 13:22:04 +00:00
Reid Kleckner 2f7fe8acb3 Use -ffreestanding in ms-intrin.cpp and define size_t manually.
llvm-svn: 190985
2013-09-19 01:54:40 +00:00
Eli Friedman 29749d2e3b Fix use-after-free in r190980.
llvm-svn: 190984
2013-09-19 01:51:23 +00:00
Craig Topper 2956112308 Use curly braces all the way through long if/else chain for consistency and readability.
llvm-svn: 190982
2013-09-19 01:13:07 +00:00
Eli Friedman 7127108357 Fix crash with cast of value-dependent expr.
We don't really need to perform semantic analysis on the dependent expression
anyway, so just call the cast dependent.

<rdar://problem/15012610>

llvm-svn: 190981
2013-09-19 01:12:33 +00:00
Eli Friedman 0834a4b901 Make Preprocessor::Lex non-recursive.
Before this patch, Lex() would recurse whenever the current lexer changed (e.g.
upon entry into a macro). This patch turns the recursion into a loop: the
various lex routines now don't return a token when the current lexer changes,
and at the top level Preprocessor::Lex() now loops until it finds a token.
Normally, the recursion wouldn't end up being very deep, but the recursion depth
can explode in edge cases like a bunch of consecutive macros which expand to
nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this
patch).

<rdar://problem/14569770>

llvm-svn: 190980
2013-09-19 00:41:32 +00:00
Reid Kleckner 5cc15addbe Avoid including <stdlib.h> in the intrin.h test
llvm-svn: 190979
2013-09-19 00:32:11 +00:00
Reid Kleckner f0e232287a Fix ifdef ordering at the end of Intrin.h from r190965
Test that intrin.h at least parses in C++ TUs.

llvm-svn: 190978
2013-09-19 00:19:53 +00:00
Craig Topper 5f79e2661d Disabling sse2 should disable aes and pclmul support.
llvm-svn: 190977
2013-09-19 00:01:05 +00:00
Eli Friedman 626956111d Add specific warning flags for GNU ext in Sema.
This patch adds the following, more specific warning flags:

gnu-anonymous-struct
gnu-compound-literal-initializer
gnu-empty-struct
gnu-flexible-array-initializer
gnu-flexible-array-union-member
gnu-folding-constant
redeclared-class-member
gnu-redeclared-enum
gnu-union-cast
gnu-variable-sized-type-not-at-end

Patch by Peter Lewis.

llvm-svn: 190972
2013-09-18 23:23:17 +00:00
Eli Friedman f9edb00fa4 Fix CharByteWidth assertion in LiteralSupport.
Patch by Eelis van der Weegen.

llvm-svn: 190971
2013-09-18 23:23:13 +00:00
Richard Smith 7506e6bf25 Remove a bogus diagnostic preventing static data member templates from being
defined with no initializer.

llvm-svn: 190970
2013-09-18 23:09:24 +00:00
Eric Christopher cc87253f90 Fix closing brace around ifdef.
llvm-svn: 190965
2013-09-18 22:40:18 +00:00
Hans Wennborg 9cb7d9ba94 clang-cl: Don't warn about overriding /MD with /MT, /Fo with another /Fo, etc.
I put in the warnings because MSVC has them, but I don't think they're very
useful.

Clang does not warn about overriding flags in general, e.g. it's perfectly
fine to have -fomit-frame-pointer followed by -fno-omit-frame-pointer.

We should focus on warning where things get confusing, such as with the
/TP and /TC options. In "clang-cl /TC a.c /TP b.cc", the user might not
realize that the /TP flag will apply to both files, and we warn about that.

Differential Revision: http://llvm-reviews.chandlerc.com/D1718

llvm-svn: 190964
2013-09-18 22:26:39 +00:00
Eric Christopher 0db88a7d7e The intrinsics should all have C linkage.
llvm-svn: 190963
2013-09-18 22:24:01 +00:00
Adrian Prantl 7f2ef22452 get rid of extra parentheses.
llvm-svn: 190962
2013-09-18 22:18:17 +00:00
Adrian Prantl 0315f38a92 Debug info: Explicitly set the DIVariable::isIndirect() flag for VLAs.
This allows us to get rid of an ugly hack in the backend.
Paired commit with LLVM.

llvm-svn: 190960
2013-09-18 22:08:57 +00:00
Richard Smith 5977d875c1 Remove some dead code.
llvm-svn: 190959
2013-09-18 21:55:14 +00:00
Fariborz Jahanian 1c900bcf26 ObjectiveC migrator: For consistency, also infer
'instancetype' for known family of methods
with related result type; such as 'init'
methods. // rdar://14987948

llvm-svn: 190956
2013-09-18 20:35:47 +00:00
Jordan Rose 36bc6b4559 [analyzer] Don't even try to convert floats to booleans for now.
We now have symbols with floating-point type to make sure that
(double)x == (double)x comes out true, but we still can't do much with
these. For now, don't even bother trying to create a floating-point zero
value; just give up on conversion to bool.

PR14634, C++ edition.

llvm-svn: 190953
2013-09-18 18:58:58 +00:00
Fariborz Jahanian 2ba62a7206 ObjectiveC migrator: Infer property in the presense
of methods annotated with attributes. 
// rdar://14987909

llvm-svn: 190947
2013-09-18 17:22:25 +00:00
Fariborz Jahanian e47a14addc ObjectiveC migrator: placing another check for
'deprecated' container before doing the 'instancetype'
inference.

llvm-svn: 190943
2013-09-18 15:43:52 +00:00
Daniel Jasper dcab7fbb83 Simplify clang-format-diff.py using new clang-format options.
clang-format's -lines parameter makes this significantly easier.

llvm-svn: 190935
2013-09-18 12:14:09 +00:00
Joey Gouly 1e8637b259 [ARMv8] Add builtins for CRC instructions.
Patch by Bradley Smith!

llvm-svn: 190931
2013-09-18 10:07:09 +00:00
Stepan Dyatkovskiy b88c30facd Recommited:
Fix for PR16752. Second commit.

PR16752: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width.
2. Fix handleModeAttr according to new methods in TargetInfo.

Fixes:
1st Commit (Done): Add new methods for TargetInfo:
     getRealTypeByWidth and getIntTypeByWidth
  for ASTContext names are almost same(invokes new methods from TargetInfo):
     getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function.

Also test/Sema/attr-mode.c was fixed. 'XC' mode test was disabled for PPC64 machines.

llvm-svn: 190926
2013-09-18 09:08:52 +00:00
Amaury de la Vieuville 718ce62b3c Add support for poly16 vtst and vtstq
vtst and vtstq currently support poly8 types, but they should also work on
poly16.

llvm-svn: 190925
2013-09-18 08:33:53 +00:00
Hal Finkel 33be5e0e5c Add new libm LIBBUILTIN definitions, synchronizing with __builtin_*
For all libm __builtin_* functions that are defined, this adds the
corresponding LIBBUILTIN definitions (tagged, as necessary, with "e" instead of
"c" when the function may set errno).

Note that this changes the current definitions for lrint and fma
(unfortunately). The Linux man page documents that these don't set errno, but
the POSIX standard says that they should.

llvm-svn: 190922
2013-09-18 06:19:40 +00:00
Hal Finkel c4d7c82c7f Add the intrinsic __builtin_convertvector
LLVM supports applying conversion instructions to vectors of the same number of
elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to
cause such instructions to be generated when using builtin vector types.

C-style casting on vectors is already defined in terms of bitcasts, and so
cannot be used for these conversions as well (without leading to a very
confusing set of semantics). As a result, this adds a __builtin_convertvector
intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is
intended to aid the creation of vector intrinsic headers that create generic IR
instead of target-dependent intrinsics (in other words, this is a generic
_mm_cvtepi32_ps). As noted in the documentation, the action of
__builtin_convertvector is defined in terms of the action of a C-style cast on
each vector element.

llvm-svn: 190915
2013-09-18 03:29:45 +00:00
Hal Finkel 4c2316be49 Remove unnecessary comment regarding AsTypeExpr base class
llvm-svn: 190914
2013-09-18 03:29:09 +00:00
Richard Smith ef985ac91c Fix accepts-invalid if a variable template explicit instantiation is missing an
argument list, but could be instantiated with argument list of <>.

llvm-svn: 190913
2013-09-18 02:10:12 +00:00
Eli Friedman 1d24af872d Fix ObjC @encode for C++ classes w/virtual bases.
PR17142.

llvm-svn: 190912
2013-09-18 01:59:16 +00:00
Richard Smith d25789a671 -ast-dump support for variable templates.
llvm-svn: 190911
2013-09-18 01:36:02 +00:00
Richard Smith 785067eca7 If a variable template specialization with an incomplete array type is
referenced, try to instantiate its definition in order to complete the type.

llvm-svn: 190910
2013-09-18 01:35:26 +00:00
Hans Wennborg e693e8432e Add comment about exporting clang::driver::ArgStringList,
as suggested by Jordan on IRC. Also, use the unqualified name
in Job.cpp.

And while we're here, refer to StringRef with the unqualified
name, because we have a using directive for that too.

llvm-svn: 190909
2013-09-18 00:41:15 +00:00
Reid Kleckner c106fdafdd Claim compatibility with VS 2012 by default
This will define _MSC_VER to 1700 by default and avoid linker errors
from /failifmismatch linker directives in the C++ standard headers.

Most people trying out the Visual Studio integration are using 2012,
since that's the only version that clang-format works with.  This way
they don't have to pass funky -Xclang -fmsc-version=1700 flags just to
link against the standard C++ runtime.

llvm-svn: 190908
2013-09-18 00:33:59 +00:00
Hans Wennborg 0daa1225c6 Revert r190902 and r190906
The first one broke the build, and the latter one made it worse.

llvm-svn: 190907
2013-09-18 00:21:51 +00:00
Hans Wennborg 9b7c8a378a Revert "Move using directive from Job.h to Job.cpp" (r190902)
Seems like it was intentional to export ArgStringList as
driver::ArgStringList, and e.g. examples/clang-interpreter/main.cpp
uses it this way.

However, exporting it with a typedef seems like a more common way to do it.

llvm-svn: 190906
2013-09-18 00:17:07 +00:00
David Majnemer 50ce835ecb Revert "Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately""
This reverts commit r190895 which reverted r190892.

llvm-svn: 190904
2013-09-17 23:57:10 +00:00
Hans Wennborg 138be5e9f4 Move using directive from Job.h to Job.cpp
I don't think it belongs in the header, but seems handy in the .cpp file.

llvm-svn: 190902
2013-09-17 23:37:44 +00:00
Fariborz Jahanian 6e1798e36a ObjectiveC migrator. infer NS_OPTIONS correctly in the
presense of parenthesized enumerator initializers.

llvm-svn: 190901
2013-09-17 23:32:51 +00:00
Hans Wennborg cfe2109978 clang-cl: ignore ths /GS- flag
The /GS- flag is used to turn off run-time buffer security checks (/GS).
Since no such checks are enabled in the first place, I think we should just
ignore this flag.

llvm-svn: 190900
2013-09-17 23:27:39 +00:00
David Majnemer 3775441379 Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately"
This reverts commit r190892.

llvm-svn: 190895
2013-09-17 22:45:28 +00:00
Fariborz Jahanian f6c6505eaa ObjectiveC migrator: Don't infer property from
'deprected' setters either. // rdar://14989365

llvm-svn: 190894
2013-09-17 22:41:25 +00:00
David Majnemer 1ebb145bdf [-cxx-abi microsoft] Mangle local TagDecls appropriately
Summary:
When selecting a mangling for an anonymous tag type:
- We should first try it's typedef'd name.
- If that doesn't work, we should mangle in the name of the declarator
  that specified it as a declaration specifier.
- If that doesn't work, fall back to a static mangling of
  <unnamed-type>.

This should make our anonymous type mangling compatible.

This partially fixes PR16994; we would need to have an implementation of
scope numbering to get it right (a separate issue).

Reviewers: rnk, rsmith, rjmccall, cdavis5x

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1540

llvm-svn: 190892
2013-09-17 22:21:27 +00:00
Fariborz Jahanian 75226d5c0d ObjectiveC migrator. Ignore migrating 'deprecated'
entities. // rdar://14989365

llvm-svn: 190890
2013-09-17 21:56:04 +00:00
Fariborz Jahanian 4c3d9c5e24 ObjectiveC migrator: Don't infer a property from isXXX method
of retainable object (readonly or otherwise).

llvm-svn: 190881
2013-09-17 19:38:55 +00:00
Argyrios Kyrtzidis 85230d50f2 [arcmt] Don't try to handle files that are already ARC'ified, this is not possible currently.
rdar://14461559

llvm-svn: 190880
2013-09-17 19:14:29 +00:00
Fariborz Jahanian 92f7242a56 ObjectiveC migrator. Infer property in categories
declared as getter with or without setter method.
// rdar://15010020

llvm-svn: 190878
2013-09-17 19:00:30 +00:00
Fariborz Jahanian ff0c460863 ObjectiveC modern translator: Provide proper cast of
the ObjectiveC object of an @synchronized statement.
// rdar://14993814

llvm-svn: 190874
2013-09-17 17:51:48 +00:00
Daniel Jasper fb81b09d87 clang-format: Don't accidentally move tokens into preprocessor directive.
This fixes llvm.org/PR17265.

Before:
  Foo::Foo()
  #ifdef BAR
      : baz(0)
  #endif {
  }

After:
  Foo::Foo()
  #ifdef BAR
      : baz(0)
  #endif
  {
  }

llvm-svn: 190861
2013-09-17 09:52:48 +00:00
Daniel Jasper 545c652d75 clang-format: Add comment to tests explaining their grouping.
llvm-svn: 190858
2013-09-17 09:26:07 +00:00
Daniel Jasper 88f9222c4e clang-format: Fix line breaking bug after empty ifs.
Before:
  if () {
  }
    else {
  }

After:
  if () {
  } else {
  }

This fixed llvm.org/PR17262.

llvm-svn: 190855
2013-09-17 08:28:05 +00:00
Daniel Jasper 0de8efa63d clang-format: Don't split a >>-operator.
Before (with column limit 60):
  aaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa >
      > aaaaa);

After:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaa >> aaaaa);

(Not sure how that could have stayed in that long without being
detected..)

llvm-svn: 190854
2013-09-17 08:15:46 +00:00
Craig Topper 86d79ef4b8 Push contents of X86TargetInfo::setFeatureEnabled down to a static function called by the virtual version and all the places in getDefaultFeatures. This way getDefaultFeatures doesn't make so many virtual calls.
llvm-svn: 190847
2013-09-17 04:51:29 +00:00
Craig Topper 13f61a6c37 Mark setSSELevel/setMMXLevel/setXOPLevel as static since they don't access anything in the class.
llvm-svn: 190846
2013-09-17 04:12:55 +00:00
Eli Friedman b2a8d464aa Don't build extra init lists.
AssignConvertType::IncompatibleVectors means the two types are in fact
compatible. :)

No testcase; I don't think the extra init list has any actual visible effect
other than making the resulting AST dump look a bit strange.

llvm-svn: 190845
2013-09-17 04:07:04 +00:00
Eli Friedman 1409e6e7c6 Fix const-eval of vector init-lists of a vector.
Like any other type, an init list for a vector can have the same type as
the vector itself; handle that case.

<rdar://problem/14990460>

llvm-svn: 190844
2013-09-17 04:07:02 +00:00
Anna Zaks 226a56fa1d [analyzer] More reliably detect property accessors.
This has a side effect of preventing a crash, which occurs because we get a
property getter declaration, which is overriding but is declared inside
@protocol. Will file a bug about this inconsistency internally. Getting a
small test case is very challenging.

llvm-svn: 190836
2013-09-17 01:30:57 +00:00
Anna Zaks fb05094b52 [analyzer] Stop tracking the objects with attribute cleanup in the RetainCountChecker.
This suppresses false positive leaks. We stop tracking a value if it is assigned to a variable declared with a cleanup attribute.

llvm-svn: 190835
2013-09-17 00:53:28 +00:00
Eli Friedman 9fc443aaed Address review comment on r189557.
We need to escape filenames the same way in InclusionRewriter whether
UseLineDirective is true or false.

Review comment from http://llvm.org/bugs/show_bug.cgi?id=17018#c2

llvm-svn: 190834
2013-09-17 00:51:31 +00:00
Eli Friedman 963ff2c366 Fix potential race in module building code.
Let the module building code handle the case of overwriting an existing file
itself, so the existing locking infrastructure works correctly.

<rdar://problem/14403381>

llvm-svn: 190833
2013-09-17 00:51:29 +00:00
Hans Wennborg 1f84980bbf cl-options.c just use touch to create that .obj file
llvm-svn: 190832
2013-09-17 00:50:43 +00:00
Hans Wennborg dc674a57d3 Fix test/Driver/cl-options.c test
The test builds an object file to be able to get into linking mode
with a valid obj file on the command-line. Using clang-cl for this,
which targets win32, caused problems on some buildbots, so just
use regular clang.

llvm-svn: 190829
2013-09-17 00:25:08 +00:00
Hans Wennborg a8ef14f3f4 clang-cl: ignore compile-only options in link-only invocations.
Previously we would warn about unused arguments such as /MD when linking.
Clang already has logic to ignore compile-only options, e.g. for -D and -U.
This patch extends that to include clang-cl's compile-only options too.

Also, some clang-cl options should always be ignored. Doing this earlier
means they get ignored both for compilation and link-only invocations.

llvm-svn: 190825
2013-09-17 00:03:41 +00:00
David Majnemer fab61e95f3 ffreestanding shouldn't effect main() on win32
llvm-svn: 190824
2013-09-16 23:59:35 +00:00
Hans Wennborg 7baa983a7e clang-cl: ignore all /w<foo> options
We previously ignored /wd<n>, but I think we can ignore the rest too.

llvm-svn: 190819
2013-09-16 23:11:56 +00:00
David Majnemer c729b0b506 [-cxx-abi microsoft] Correctly identify Win32 entry points
Summary:
This fixes several issues with the original implementation:
- Win32 entry points cannot be in namespaces
- A Win32 entry point cannot be a function template, diagnose if we it.
- Win32 entry points cannot be overloaded.
- Win32 entry points implicitly return, similar to main.

Reviewers: rnk, rsmith, whunt, timurrrr

Reviewed By: rnk

CC: cfe-commits, nrieck

Differential Revision: http://llvm-reviews.chandlerc.com/D1683

llvm-svn: 190818
2013-09-16 22:44:20 +00:00
Richard Trieu 3a446ff6a4 Move the uninitialized field check to after all the field initializers are added
to the CXXConstructorDecl so that information from the constructor can be used.

llvm-svn: 190810
2013-09-16 21:54:53 +00:00
Reid Kleckner 543a16c06b Emit an error when attempting to generate IR for SEH __try
Currently we silently omit the code in the try and finally bodies, which
is pretty bad.  This way we fail loudly.

llvm-svn: 190809
2013-09-16 21:46:30 +00:00
Richard Smith 12a41bd3e0 Add some missing ProhibitAttributes calls to some declaration-like #pragmas.
llvm-svn: 190806
2013-09-16 21:17:44 +00:00
Richard Trieu fd68777c7b Pass additional information around the uninitialized field visitor.
llvm-svn: 190805
2013-09-16 20:46:50 +00:00
Alexander Kornienko 81e3294e7e When in pre-c++11 mode, treat _T("xxx") as a single string literal, repeat the _T() part around each fragment. This addresses http://llvm.org/PR17122
Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek, rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1640

llvm-svn: 190804
2013-09-16 20:20:49 +00:00
Aaron Ballman 6e2dd7b553 Updated the way the ownership attributes are semantically diagnosed. Added test cases for the semantics checks.
llvm-svn: 190802
2013-09-16 18:11:41 +00:00
Amara Emerson 8c3de546d6 Add error checking to reject neon_vector_type attribute on targets without NEON.
Patch by Artyom Skrobov.

llvm-svn: 190801
2013-09-16 18:07:35 +00:00
Anton Yartsev f5bcccee76 New message for cases when ownership is taken:
"+method_name: cannot take ownership of memory allocated by 'new'."
instead of the old
"Memory allocated by 'new' should be deallocated by 'delete', not +method_name"

llvm-svn: 190800
2013-09-16 17:51:25 +00:00
Argyrios Kyrtzidis 07ee5c44b4 [libclang] Don't report a DecayedType as "unexposed", report it as the original (as written) type.
Patch by Anders Waldenborg!

llvm-svn: 190796
2013-09-16 17:26:23 +00:00
Benjamin Kramer 4d6efbb28a Add a define for the ObjFW runtime ABI version.
This removes __has_feature(objc_msg_lookup_stret), as it is not required
anymore after this patch.

Patch by Jonathan Schleifer!

llvm-svn: 190791
2013-09-16 16:31:49 +00:00
Jordan Rose 3bde507a7a [analyzer] scan-build: add missing semicolon
Patch by Kevin Zheng!

llvm-svn: 190789
2013-09-16 16:17:18 +00:00
Wei Pan c354d2177a Handle PredefinedExpr with templates and lambdas
Summary:

- lambdas, blocks or captured statements in templates were not
  handled which causes codegen crashes.

Differential Revision: http://llvm-reviews.chandlerc.com/D1628

llvm-svn: 190784
2013-09-16 13:57:27 +00:00
Craig Topper 31db3a2efc Make F16C feature imply AVX. Matches GCC behavior.
llvm-svn: 190776
2013-09-16 04:54:13 +00:00
NAKAMURA Takumi c5d86153ed Prune "return" after llvm_unreachable(). It was redundant.
llvm-svn: 190774
2013-09-16 01:58:47 +00:00
Ed Schouten 401aebab93 Make __has_extension(c_thread_local) work.
Unlike C++11's "thread_local" keyword, C11's "_Thread_local" is in the
reserved namespace, meaning we provide it unconditionally; it is marked
as KEYALL in TokenKinds.def.

This means that like all the other C11 keywords, we can expose its
presence through __has_extension().

llvm-svn: 190755
2013-09-14 16:17:20 +00:00
Serge Pavlov d5489074e6 Avoid getting an argument of allocation function if it does not exist.
This is a fix to PR12778: in erroneous code an allocation function
can be declared with no arguments, quering the first argument in this case
causes assertion violation.

llvm-svn: 190751
2013-09-14 12:00:01 +00:00
Daniel Jasper 5c9e3cdb6d clang-format: Fix bug in style option AlwaysBreakTemplateDeclarations.
Before:
  template <template <typename>
            class Fooooooo, template <typename>
            class Baaaaaaar>
  struct C {};

After:
  template <template <typename> class Fooooooo,
            template <typename> class Baaaaaaar>
  struct C {};

llvm-svn: 190747
2013-09-14 08:13:22 +00:00
David Majnemer 90b1729af9 Parse: Template specializations which aren't dependent needn't have their parsing be delayed
Summary:
We should treat a non-dependent template specialization like it wasn't
templated at all.

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1554

llvm-svn: 190743
2013-09-14 05:46:42 +00:00
Cameron Esfahani 556d91e2c3 Clean up some Triple usage in clang.
llvm-svn: 190737
2013-09-14 01:09:11 +00:00
Jordan Rose e10c859583 [analyzer] Put more uniqueness in scan-build's temporary directory names.
This is necessary when running two scan-build processes in parallel. The
directory naming scheme is now:

  yyyy-MM-dd-HHmmss-PID-N
  2013-09-13-174210-123-1

where "PID" is the scan-build process ID, and "N" is a sequential counter
(not likely to be needed now that seconds are mangled in, but just in case).

PR17196, using a suggested fix from Greg Czajkowski!

llvm-svn: 190735
2013-09-14 00:41:32 +00:00
Eric Christopher 138c32b402 Add support for -ggnu-pubnames matching the llvm support.
llvm-svn: 190729
2013-09-13 22:37:55 +00:00
Michael Han 2d6f64e5ae Fix a comment.
llvm-svn: 190728
2013-09-13 22:24:50 +00:00
Reid Kleckner 881dff3683 Lex and ignore Microsoft's #pragma warning(...)
Summary:
This fixes PR17145 and avoids unknown pragma warnings.

This change does not attempt to map MSVC warning numbers to clang
warning flags.  Perhaps in the future we will implement a mapping for
some common subset of Microsoft warnings, but for now we don't.

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1652

llvm-svn: 190726
2013-09-13 22:00:30 +00:00
Richard Smith 17e32460ed Part three of PR15721: if we have an invalid CXXDefaultInitExpr, don't crash if
we try to constant-evaluate it. Patch by Karthik Bhat, test by me.

llvm-svn: 190722
2013-09-13 20:51:45 +00:00
Aaron Ballman 8c9795d9fa vector_size cannot be applied to Booleans. Updated the semantic checking logic, as well as the comment and added a test case. Fixes PR12649
llvm-svn: 190721
2013-09-13 20:43:08 +00:00
Aaron Ballman 3b1dde63a2 Switching the WeakRef attribute to using the new checkStringLiteralArgument helper function.
llvm-svn: 190719
2013-09-13 19:35:18 +00:00
Preston Gurd a3c58c02f1 Update Atom Silvermont (SLM) support by adding enabled features.
llvm-svn: 190718
2013-09-13 19:27:17 +00:00
David Blaikie dedd27fc62 DebugInfo: omit debug info for friends
GCC ToT doesn't do this & it's worth about 3.2% on Clang's DWO file size
with Clang. Some or all of this may be due to things like r190715 which
could have source fixes/improvements, but it's not clear that's the case
and that doesn't help other source bases.

llvm-svn: 190716
2013-09-13 18:45:00 +00:00
David Blaikie 0a4e61f81c Remove unnecessary inclusion of Sema.h
Let me tell you a tale...

Within some twisted maze of debug info I've ended up implementing an
insane man's Include What You Use device. When the debugger emits debug
info it really shouldn't, I find out why & then realize the code could
be improved too.

In this instance CIndexDiagnostics.cpp had a lot more debug info with
Clang than GCC. Upon inspection a major culprit was all the debug info
describing clang::Sema. This was emitted because clang::Sema is
befriended by DiagnosticEngine which was rightly required, but GCC
doesn't emit debug info for friends so it never emitted anything for
Clang. Clang does emit debug info for friends (will be fixed/changed to
reduce debug info size).

But why didn't Clang just emit a declaration of Sema if this entire TU
didn't require a definition?

1) Diagnostic.h did the right thing, only using a declaration of Sema
and not including Sema.h at all.
2) Some other dependency of CIndexDiagnostics.cpp didn't do the right
thing. ASTUnit.h, only needing a declaration, still included Sema.h
(hence this commit which removes that include and adds the necessary
includes to the cpp files that were relying on this)
3) -flimit-debug-info didn't save us because of
EnterExpressionEvaluationContext, defined inline in Sema.h which fires
the "requiresCompleteType" check/flag (since it uses nested types from
Sema and calls Sema member functions) and thus, if debug info is ever
emitted for the type, the whole type is emitted and not just a
declaration.

Improving -flimit-debug-info to account for this would be... hard.
Modifying the code so that's not 'required to be complete' might be
possible, but probably only by moving EnterExpressionEvaluationContext
either into Sema, or out of Sema.h. That might be a bit too much of a
contortion to be bothered with.

Also, this is only one of the cases where emitting debug info for
friends caused us to emit a lot more debug info (this change reduces
Clang's DWO size by 0.93%, dropping friends entirely reduces debug info
by 3.2%) - I haven't hunted down the other cases, but I assume they
might be similar (Sema or something like it). IWYU or a similar tool
might help us reduce build times a bit, but analyzing debug info to find
these differences isn't worthwhile. I'll take the 3.2% win, provide this
small improvement to the code itself, and move on.

llvm-svn: 190715
2013-09-13 18:32:52 +00:00
David Blaikie 5cc6cc1326 Fix indentation of closing };
llvm-svn: 190711
2013-09-13 17:56:13 +00:00
Aaron Ballman d6600a5b9b Updated the PCS calling convention to use the new checkStringLiteralArgument helper function.
llvm-svn: 190710
2013-09-13 17:48:25 +00:00
Benjamin Kramer a9dfa9280e As Aaron pointed out it's simpler to reject wide string availability attr messages in the parser.
llvm-svn: 190706
2013-09-13 17:31:48 +00:00
NAKAMURA Takumi 5c81ca460e ASTContext.cpp: Fix a warning in r190684. [-Wcovered-switch-default]
llvm-svn: 190705
2013-09-13 17:12:09 +00:00
Renato Golin 6031230e82 Moving Cortex-R cores to armv7r arch
llvm-svn: 190704
2013-09-13 17:02:59 +00:00
Renato Golin 1a04f22356 Add more Cortex CPUs and tests
llvm-svn: 190703
2013-09-13 17:02:54 +00:00
Renato Golin eefb577be8 Fix Neon detection for Cortex-A class, plus adds some more CPUs to default features
llvm-svn: 190702
2013-09-13 17:02:45 +00:00
Benjamin Kramer ca9fe1453f Guard availability and thread safety attributes against wide strings.
Found by inspection.

llvm-svn: 190701
2013-09-13 16:30:12 +00:00
Benjamin Kramer 6ee1562cfc Unify handling of string literal arguments for attributes and add fixits.
This fixes a couple of latent crashes for invalid attributes and also adds a
fixit hint to turn identifiers into string literals if one was expected. It then
proceeds recovery as if the identifier was a literal. Diagnostic locations are
also changed to point at the literal instead of the attribute if the error
concerns the argument. PR17175.

For example:
hidden.c:1:40: error: 'visibility' attribute requires a string
extern int x __attribute__((visibility(hidden)));
                                       ^
                                       "     "
hidden.c:2:29: error: visibility does not match previous declaration
extern int x __attribute__((visibility("default")));
                            ^
hidden.c:1:29: note: previous attribute is here
extern int x __attribute__((visibility(hidden)));
                            ^

llvm-svn: 190699
2013-09-13 15:35:43 +00:00
Joey Gouly be8c27372a [ARMv8] Change the naming of some options to be more consistent.
Clang side changes for LLVM r190692.

llvm-svn: 190693
2013-09-13 13:48:33 +00:00
Daniel Jasper e488f5dd1e clang-format: Add -assume-filename option for editor integrations.
With -style=file, clang-format now starts to search for a .clang-format
file starting at the file given with -assume-filename if it reads from
stdin. Otherwise, it would start searching from the current directory,
which is not helpful for editor integrations.

Also changed vim, emacs and sublime integrations to actually make use of
this flag.

This fixes llvm.org/PR17072.

llvm-svn: 190691
2013-09-13 13:40:24 +00:00
Alexander Kornienko 95b3be36e0 Added missing field comparisons to the FormatStyle::operator==
llvm-svn: 190688
2013-09-13 12:54:40 +00:00
David Tweed 4fd0234e54 A buildbot compiling with strict error on unused variables pointed out a
historical remnant in r190684; remove it.

llvm-svn: 190687
2013-09-13 12:51:05 +00:00
David Tweed 31d09b0cef Certain multi-platform languages, such as OpenCL, have the concept of
address spaces which is both (1) a "semantic" concept and
(2) possibly a hardware level restriction. It is desirable to
be able to discard/merge the LLVM-level address spaces on arguments for which
there is no difference to the current backend while keeping
track of the semantic address spaces in a funciton prototype. To do this
enable addition of the address space into the name-mangling process. Add
some tests to document this behaviour against inadvertent changes.

Patch by Michele Scandale!

llvm-svn: 190684
2013-09-13 12:04:22 +00:00
Amaury de la Vieuville 7681afdff0 Add "native" to config.available_features, to make it easier to disable non-x-compile-safe tests
Patch by Artyom Skrobov!

llvm-svn: 190681
2013-09-13 11:02:31 +00:00
Daniel Jasper f3d977979c clang-format: Detect braced lists in subscript expressions.
Before (even with Style.Cpp11BracedListStyle):
  f(MyMap[{ composite, key }]);

After:
  f(MyMap[{composite, key}]);

llvm-svn: 190678
2013-09-13 10:55:31 +00:00
David Majnemer 9d0bb9d2ba [-cxx-abi microsoft] Mangle user defined entry points properly
Summary:
Functions named "main", "wmain", "WinMain", "wWinMain", and "DllMain"
are never mangled regardless of linkage, even when compiling for kernel
mode.
Depends on D1655

Reviewers: timurrrr, pcc, rnk, whunt

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1670

llvm-svn: 190675
2013-09-13 09:40:55 +00:00
Daniel Jasper 015ed028cf clang-format: Fix incorrect enum parsing / layouting.
Before:
  enum {
    Bar = Foo < int,
    int > ::value
  };

After:
  enum {
    Bar = Foo<int, int>::value
  };

llvm-svn: 190674
2013-09-13 09:20:45 +00:00
David Majnemer d5a42b8b48 [-cxx-abi microsoft] Mangle declarations inside extern "C"
Summary:
This is a first step to getting extern "C" working properly inside
clang.  There are a number of quirks but mangling declarations inside
such a function are a good first step.

Reviewers: timurrrr, pcc, cdavis5x

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1655

llvm-svn: 190671
2013-09-13 09:03:14 +00:00
David Majnemer 5f6c860cfc CHECK -> CHECK-DAG
llvm-svn: 190670
2013-09-13 08:59:19 +00:00
Richard Trieu 1bc22c12cb Refactor the uninitialized field visitor. Also moved the calls to the visitor
later in the code so that the expressions will have addition processing first.
This catches a few additional cases of uninitialized uses of class fields.

llvm-svn: 190657
2013-09-13 03:20:53 +00:00
James Dennett 7ac694e87e Documentation: Doxygen-ification of existing docs for Sema/DelayedDiagnostic.h.
llvm-svn: 190656
2013-09-13 02:58:19 +00:00
James Dennett bba389b107 Documentation cleanup: Fixing \brief comments, migrating away from old style
that duplicated the name of the entity being documented at the start of its
comment, and other minor tidyups.

llvm-svn: 190655
2013-09-13 02:46:09 +00:00
Jordan Rose 3ea5886d14 Fix two incorrect comments.
Patch by Jared Grubb!

llvm-svn: 190652
2013-09-13 00:45:22 +00:00
Jordan Rose 8dddf8ff20 [analyzer] Fix copy-paste error in internal docs.
Patch by Jared Grubb!

llvm-svn: 190651
2013-09-13 00:44:57 +00:00
Jordan Rose cb7b7eaff0 [analyzer] Run post-stmt checks for DeclStmt.
No tests because no in-tree checkers use this, but that shouldn't stop
out-of-tree checkers.

Found by Aemon Cannon!

llvm-svn: 190650
2013-09-13 00:44:47 +00:00
Hal Finkel 28b2ae3692 Restore the sqrt -> llvm.sqrt mapping in fast-math mode
This restores the sqrt -> llvm.sqrt mapping, but only in fast-math mode
(specifically, when the UnsafeFPMath or NoNaNsFPMath CodeGen options are
enabled). The @llvm.sqrt* intrinsics have slightly different semantics from the
libm call, specifically, they are undefined when given a non-zero negative
number (the libm calls will always return NaN for any negative number).

This mapping was removed in r100613, and replaced with a TODO, but at that time
the fast-math flags were not yet implemented. Now that we have these, restoring
this mapping is important because it will enable autovectorization of sqrt
calls in loops (at least in fast-math mode).

llvm-svn: 190646
2013-09-12 23:57:55 +00:00
Nick Lewycky 3141d605b9 Fix typo in llvm_unreachable string.
llvm-svn: 190641
2013-09-12 23:36:08 +00:00
Richard Smith 1fff95c702 PR13657 (and duplicates):
When a comma occurs in a default argument or default initializer within a
class, disambiguate whether it is part of the initializer or whether it ends
the initializer.

The way this works (which I will be proposing for standardization) is to treat
the comma as ending the default argument or default initializer if the
following token sequence matches the syntactic constraints of a
parameter-declaration-clause or init-declarator-list (respectively).

This is both consistent with the disambiguation rules elsewhere (where entities
are treated as declarations if they can be), and should have no regressions
over our old behavior. I think it might also disambiguate all cases correctly,
but I don't have a proof of that.

There is an annoyance here: because we're performing a tentative parse in a
situation where we may not have seen declarations of all relevant entities (if
the comma is part of the initializer, lookup may find entites declared later in
the class), we need to turn off typo-correction and diagnostics during the
tentative parse, and in the rare case that we decide the comma is part of the
initializer, we need to revert all token annotations we performed while
disambiguating.

Any diagnostics that occur outside of the immediate context of the tentative
parse (for instance, if we trigger the implicit instantiation of a class
template) are *not* suppressed, mirroring the usual rules for a SFINAE context.

llvm-svn: 190639
2013-09-12 23:28:08 +00:00